Commit ee4571db authored by Paul Mackerras's avatar Paul Mackerras

[PATCH] ppp ldisc close deadlock prevention

Jeff Garzik writes:

> So what was the resolution of this?

This patch is what we want.  We don't in fact need to do the read
lock, only the write lock, which is what the original patch did.
However, we need to do it in ppp_synctty.c as well as ppp_async.c.

Thanks to John K Luebs <jkluebs@luebsphoto.com> for pointing out the
problem.
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent a74a0064
...@@ -205,10 +205,10 @@ ppp_asynctty_close(struct tty_struct *tty) ...@@ -205,10 +205,10 @@ ppp_asynctty_close(struct tty_struct *tty)
{ {
struct asyncppp *ap; struct asyncppp *ap;
write_lock(&disc_data_lock); write_lock_irq(&disc_data_lock);
ap = tty->disc_data; ap = tty->disc_data;
tty->disc_data = 0; tty->disc_data = 0;
write_unlock(&disc_data_lock); write_unlock_irq(&disc_data_lock);
if (ap == 0) if (ap == 0)
return; return;
......
...@@ -251,10 +251,10 @@ ppp_sync_close(struct tty_struct *tty) ...@@ -251,10 +251,10 @@ ppp_sync_close(struct tty_struct *tty)
{ {
struct syncppp *ap; struct syncppp *ap;
write_lock(&disc_data_lock); write_lock_irq(&disc_data_lock);
ap = tty->disc_data; ap = tty->disc_data;
tty->disc_data = 0; tty->disc_data = 0;
write_unlock(&disc_data_lock); write_unlock_irq(&disc_data_lock);
if (ap == 0) if (ap == 0)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment