[Devel] [PATCH 2/2] e1000: fix possible reset_task running after adapter down

Jeff Kirsher jeffrey.t.kirsher at intel.com
Fri Nov 22 15:17:22 PST 2013


On Fri, 2013-11-22 at 12:20 +0400, Vladimir Davydov wrote:
> On e1000_down(), we should ensure every asynchronous work is canceled
> before proceeding. Since the watchdog_task can schedule other works
> apart from itself, it should be stopped first, but currently it is
> stopped after the reset_task. This can result in the following race
> leading to the reset_task running after the module unload:
> 
> e1000_down_and_stop():                  e1000_watchdog():
> ----------------------                  -----------------
> 
> cancel_work_sync(reset_task)
>                                         schedule_work(reset_task)
> cancel_delayed_work_sync(watchdog_task)
> 
> The patch moves cancel_delayed_work_sync(watchdog_task) at the
> beginning
> of e1000_down_and_stop() thus ensuring the race is impossible.
> 
> Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
> Cc: Tushar Dave <tushar.n.dave at intel.com>
> Cc: Patrick McHardy <kaber at trash.net>
> Cc: David S. Miller <davem at davemloft.net>
> ---
>  drivers/net/ethernet/intel/e1000/e1000_main.c |   15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)

I have applied your patch to my queue, thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openvz.org/pipermail/devel/attachments/20131122/38a74c85/attachment-0001.sig>


More information about the Devel mailing list