From: David Miller <davem@davemloft.net>
To: xie.he.0141@gmail.com
Cc: kuba@kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ms@dev.tdt.de
Subject: Re: [PATCH net] drivers/net/wan/x25_asy: Keep the ldisc running even when netif is down
Date: Mon, 28 Sep 2020 15:58:52 -0700 (PDT) [thread overview]
Message-ID: <20200928.155852.490566722532403628.davem@davemloft.net> (raw)
In-Reply-To: <20200926205610.21045-1-xie.he.0141@gmail.com>
From: Xie He <xie.he.0141@gmail.com>
Date: Sat, 26 Sep 2020 13:56:10 -0700
> @@ -265,7 +269,9 @@ static void x25_asy_write_wakeup(struct tty_struct *tty)
> * transmission of another packet */
> sl->dev->stats.tx_packets++;
> clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
> - x25_asy_unlock(sl);
> + /* FIXME: The netif may go down after netif_running returns */
> + if (netif_running(sl->dev))
> + x25_asy_unlock(sl);
> return;
It could also go back down and also back up again after you do this
test. Maybe even 10 or 100 times over.
You can't just leave things so incredibly racy like this, please apply
proper synchronization between netdev state changes and this TTY code.
Thank you.
next prev parent reply other threads:[~2020-09-28 23:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-26 20:56 Xie He
2020-09-28 22:58 ` David Miller [this message]
2020-09-29 0:36 ` Xie He
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200928.155852.490566722532403628.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ms@dev.tdt.de \
--cc=netdev@vger.kernel.org \
--cc=xie.he.0141@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®