]> bbs.cooldavid.org Git - net-next-2.6.git/commit - drivers/usb/storage/usb.c
[PATCH] USB Storage: close a race condition in disconnect near probe
authorMatthew Dharm <mdharm-usb@one-eyed-alien.net>
Thu, 28 Jul 2005 21:44:29 +0000 (14:44 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 8 Sep 2005 23:22:54 +0000 (16:22 -0700)
commit77f46328fb83b64befd889ebce6d7fb959932509
treec06b5e60d8463e548b49c73799b2327ecc4f09de
parent0f64e078139109d1902e5b1274c23cec9a9ad12e
[PATCH] USB Storage: close a race condition in disconnect near probe

This patch started life as as533, and has been re-diffed against the
current tree.

Disconnect processing in usb-storage naturally divides into two parts:
one to quiesce the driver (make sure no commands are executing or
queued) and remove the host, and the other to deallocate all the USB and
non-USB resources.  This patch creates two subroutines to handle those
two parts.  Mostly it's just code movement, but there is one significant
change.  If the scsi-scanning thread fails to initialize but the host
has successfully been added, we need to quiesce the driver before
removing the host.  After all, it's possible that scanning could have
been initiated from somewhere else, such as userspace -- very low
probability, but it's easily handled by calling the new subroutine.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/usb.c