Re: [PATCH net v4] net: lapb: Add locking to the lapb module

2021-01-20 Thread Xie He
On Wed, Jan 20, 2021 at 12:42 PM Xie He wrote: > > With this patch, there is still a problem that lapb_unregister may run > concurrently with other LAPB API functions (such as > lapb_data_received). This other LAPB API function can get the > lapb->lock after lapb->lock is released by lapb_unregist

Re: [PATCH net v4] net: lapb: Add locking to the lapb module

2021-01-20 Thread Xie He
With this patch, there is still a problem that lapb_unregister may run concurrently with other LAPB API functions (such as lapb_data_received). This other LAPB API function can get the lapb->lock after lapb->lock is released by lapb_unregister, and continue to do its work. This is not correct. We

Re: [PATCH net v4] net: lapb: Add locking to the lapb module

2021-01-20 Thread Xie He
On Wed, Jan 20, 2021 at 2:58 AM Martin Schiller wrote: > > Can you please add a Changelog. What was changed in v4? Sorry, I forgot this. Here is the change log: --- Changes from v3 to v4 --- Only lapb_unregister has been changed. v3 has a problem. When "del_timer_sync(&lapb->t1timer)" is calle

Re: [PATCH net v4] net: lapb: Add locking to the lapb module

2021-01-20 Thread Martin Schiller
On 2021-01-20 11:28, Xie He wrote: In the lapb module, the timers may run concurrently with other code in this module, and there is currently no locking to prevent the code from racing on "struct lapb_cb". This patch adds locking to prevent racing. 1. Add "spinlock_t lock" to "struct lapb_cb"; A