Make scsi_free_queue() kill pending SCSI commands
commita3576ddc753b2d9704a9e9b668becdee4c166c88
authorBart Van Assche <bvanassche@acm.org>
Fri, 23 Sep 2011 17:48:18 +0000 (23 19:48 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:44:22 +0000 (11 09:44 -0800)
treedf107608f3fa004af15862c7b4e97c5f8b2e0140
parent2ac819e95c1cf0455ba22a8a295f0998df9e33c2
Make scsi_free_queue() kill pending SCSI commands

commit 3308511c93e6ad0d3c58984ecd6e5e57f96b12c8 upstream.

Make sure that SCSI device removal via scsi_remove_host() does finish
all pending SCSI commands. Currently that's not the case and hence
removal of a SCSI host during I/O can cause a deadlock. See also
"blkdev_issue_discard() hangs forever if underlying storage device is
removed" (http://bugzilla.kernel.org/show_bug.cgi?id=40472). See also
http://lkml.org/lkml/2011/8/27/6.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/hosts.c
drivers/scsi/scsi_lib.c