]> git.baikalelectronics.ru Git - kernel.git/commit
ppp: Fix race condition with queue start/stop
authorDavid Woodhouse <dwmw2@infradead.org>
Sun, 8 Apr 2012 10:01:44 +0000 (10:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Apr 2012 17:06:47 +0000 (13:06 -0400)
commite4e37f04e8f07c4aa2e23a6bbc06409216fd2115
treee91d28ce1852c8a7016065ee2184dd2531d56892
parent1a8fac25491d3d9d636f527c5f7b72bbe4e63c30
ppp: Fix race condition with queue start/stop

Commit 709a0406e452894b881fd718788fbfc4239419c7 ("ppp: Don't stop and
restart queue on every TX packet") introduced a race condition which
could leave the net queue stopped even when the channel is no longer
busy. By calling netif_stop_queue() from ppp_start_xmit(), based on the
return value from ppp_xmit_process() but *after* all the locks have been
dropped, we could potentially do so *after* the channel has actually
finished transmitting and attempted to re-wake the queue.

Fix this by moving the netif_stop_queue() into ppp_xmit_process() under
the xmit lock. I hadn't done this previously, because it gets called
from other places than ppp_start_xmit(). But I now think it's the better
option. The net queue *should* be stopped if the channel becomes
congested due to writes from pppd, anyway.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ppp/ppp_generic.c