]> git.baikalelectronics.ru Git - kernel.git/commit
Block: use a freezable workqueue for disk-event polling
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 2 Mar 2012 09:51:00 +0000 (10:51 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 2 Mar 2012 09:51:00 +0000 (10:51 +0100)
commit588d8e0e3453022297c1f8ea3778bfa695e04577
treed335d0e449ef2d61d52921e3f210cdd403bb025a
parent8b8cb78c4781952cbc0ca9d0c7d5e12d0d2f5623
Block: use a freezable workqueue for disk-event polling

This patch (as1519) fixes a bug in the block layer's disk-events
polling.  The polling is done by a work routine queued on the
system_nrt_wq workqueue.  Since that workqueue isn't freezable, the
polling continues even in the middle of a system sleep transition.

Obviously, polling a suspended drive for media changes and such isn't
a good thing to do; in the case of USB mass-storage devices it can
lead to real problems requiring device resets and even re-enumeration.

The patch fixes things by creating a new system-wide, non-reentrant,
freezable workqueue and using it for disk-events polling.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <stable@kernel.org>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c
include/linux/workqueue.h
kernel/workqueue.c