Re: [PATCH] [v2]net:ppp: remove disc_data_lock in ppp line discipline

2021-01-04 Thread Gaoyan
Hi Greg KH: On Fri, 1 Jan 2021 09:18:48 +0100, Greg KH wrote: >On Fri, Jan 01, 2021 at 11:37:18AM +0800, Gao Yan wrote: >> In tty layer, it provides tty->ldisc_sem to protect all tty_ldisc_ops >> including ppp_sync_ldisc. So I think tty->ldisc_sem can also protect >> tty->disc_data, and the

Re: [PATCH] [v2]net:ppp: remove disc_data_lock in ppp line discipline

2021-01-04 Thread Jakub Kicinski
On Fri, 1 Jan 2021 11:37:18 +0800 Gao Yan wrote: > In tty layer, it provides tty->ldisc_sem to protect all tty_ldisc_ops > including ppp_sync_ldisc. So I think tty->ldisc_sem can also > protect tty->disc_data, and the disc_data_lock is not necessary. > > Signed-off-by: Gao Yan Please make sure

Re: [PATCH] [v2]net:ppp: remove disc_data_lock in ppp line discipline

2021-01-01 Thread Gaoyan
Hi Greg KH: We have a potential race on dereferencing tty->disc_data, so we should use some locks to avoid the competition. In the current version, it defines disc_data_lock to protect the race of ppp_asynctty_receive and ppp_asynctty_close. However, I think when cpu A is running

Re: [PATCH] [v2]net:ppp: remove disc_data_lock in ppp line discipline

2021-01-01 Thread Greg KH
On Fri, Jan 01, 2021 at 11:37:18AM +0800, Gao Yan wrote: > In tty layer, it provides tty->ldisc_sem to protect all tty_ldisc_ops > including ppp_sync_ldisc. So I think tty->ldisc_sem can also > protect tty->disc_data, and the disc_data_lock is not necessary. > > Signed-off-by: Gao Yan > --- >

[PATCH] [v2]net:ppp: remove disc_data_lock in ppp line discipline

2020-12-31 Thread Gao Yan
In tty layer, it provides tty->ldisc_sem to protect all tty_ldisc_ops including ppp_sync_ldisc. So I think tty->ldisc_sem can also protect tty->disc_data, and the disc_data_lock is not necessary. Signed-off-by: Gao Yan --- drivers/net/ppp/ppp_async.c | 11 ++-