public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Christof Schmitt <christof.schmitt@de.ibm.com>,
	James Bottomley <James.Bottomley@suse.de>
Subject: [44/45] [SCSI] Fix regressions in scsi_internal_device_block
Date: Fri, 19 Nov 2010 13:43:24 -0800	[thread overview]
Message-ID: <20101119214413.045797042@clark.site> (raw)
In-Reply-To: <20101119214439.GA26350@kroah.com>

2.6.32-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Mike Christie <michaelc@cs.wisc.edu>

commit 986fe6c7f50974e871b8ab5a800f5310ea25b361 upstream.

Deleting a SCSI device on a blocked fc_remote_port (before
fast_io_fail_tmo fires) results in a hanging thread:

  STACK:
  0 schedule+1108 [0x5cac48]
  1 schedule_timeout+528 [0x5cb7fc]
  2 wait_for_common+266 [0x5ca6be]
  3 blk_execute_rq+160 [0x354054]
  4 scsi_execute+324 [0x3b7ef4]
  5 scsi_execute_req+162 [0x3b80ca]
  6 sd_sync_cache+138 [0x3cf662]
  7 sd_shutdown+138 [0x3cf91a]
  8 sd_remove+112 [0x3cfe4c]
  9 __device_release_driver+124 [0x3a08b8]
10 device_release_driver+60 [0x3a0a5c]
11 bus_remove_device+266 [0x39fa76]
12 device_del+340 [0x39d818]
13 __scsi_remove_device+204 [0x3bcc48]
14 scsi_remove_device+66 [0x3bcc8e]
15 sysfs_schedule_callback_work+50 [0x260d66]
16 worker_thread+622 [0x162326]
17 kthread+160 [0x1680b0]
18 kernel_thread_starter+6 [0x10aaea]

During the delete, the SCSI device is in moved to SDEV_CANCEL.  When
the FC transport class later calls scsi_target_unblock, this has no
effect, since scsi_internal_device_unblock ignores SCSI devics in this
state.

It looks like all these are regressions caused by:
5c10e63c943b4c67561ddc6bf61e01d4141f881f
[SCSI] limit state transitions in scsi_internal_device_unblock

Fix by rejecting offline and cancel in the state transition.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
[jejb: Original patch by Christof Schmitt, modified by Mike Christie]
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/scsi/scsi_lib.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2432,7 +2432,8 @@ scsi_internal_device_unblock(struct scsi
 		sdev->sdev_state = SDEV_RUNNING;
 	else if (sdev->sdev_state == SDEV_CREATED_BLOCK)
 		sdev->sdev_state = SDEV_CREATED;
-	else
+	else if (sdev->sdev_state != SDEV_CANCEL &&
+		 sdev->sdev_state != SDEV_OFFLINE)
 		return -EINVAL;
 
 	spin_lock_irqsave(q->queue_lock, flags);



  parent reply	other threads:[~2010-11-19 21:46 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-19 21:44 [00/45] 2.6.32.26-stable review Greg KH
2010-11-19 21:42 ` Greg KH
2010-11-19 21:42 ` [01/45] staging: usbip: Notify usb core of port status changes Greg KH
2010-11-19 21:42 ` [02/45] staging: usbip: Process event flags without delay Greg KH
2010-11-19 21:42 ` [03/45] powerpc/perf: Fix sampling enable for PPC970 Greg KH
2010-11-19 21:42 ` [04/45] pcmcia: synclink_cs: fix information leak to userland Greg KH
2010-11-19 21:42 ` [05/45] sched: Fix string comparison in /proc/sched_features Greg KH
2010-11-19 21:42 ` [06/45] bluetooth: Fix missing NULL check Greg KH
2010-11-19 21:42 ` [07/45] futex: Fix errors in nested key ref-counting Greg KH
2010-11-19 21:42 ` [08/45] mm, x86: Saving vmcore with non-lazy freeing of vmas Greg KH
2010-11-20  2:16   ` [Stable-review] " Ben Hutchings
2010-11-22 17:59     ` Greg KH
2010-11-19 21:42 ` [09/45] x86, cpu: Fix renamed, not-yet-shipping AMD CPUID feature bit Greg KH
2010-11-19 21:42 ` [10/45] x86, kexec: Make sure to stop all CPUs before exiting the kernel Greg KH
2010-11-19 21:42 ` [11/45] x86, olpc: Dont retry EC commands forever Greg KH
2010-11-19 21:42 ` [12/45] x86, mtrr: Assume SYS_CFG[Tom2ForceMemTypeWB] exists on all future AMD CPUs Greg KH
2010-11-19 21:42 ` [13/45] x86, intr-remap: Set redirection hint in the IRTE Greg KH
2010-11-19 21:42 ` [14/45] x86, kdump: Change copy_oldmem_page() to use cached addressing Greg KH
2010-11-19 21:42 ` [15/45] KVM: SVM: Fix wrong intercept masks on 32 bit Greg KH
2010-11-19 21:42 ` [16/45] KVM: MMU: fix direct sps access corrupted Greg KH
2010-11-19 21:42 ` [17/45] KVM: MMU: fix conflict access permissions in direct sp Greg KH
2010-11-19 21:42 ` [18/45] KVM: VMX: Fix host GDT.LIMIT corruption Greg KH
2010-11-19 21:42 ` [19/45] KVM: SVM: Adjust tsc_offset only if tsc_unstable Greg KH
2010-11-19 21:43 ` [20/45] KVM: x86: Fix SVM VMCB reset Greg KH
2010-11-19 21:43 ` [21/45] [PATCH 7/8] KVM: x86: Move TSC reset out of vmcb_init Greg KH
2010-11-19 21:43 ` [22/45] KVM: Fix fs/gs reload oops with invalid ldt Greg KH
2010-11-19 21:43 ` [23/45] pipe: fix failure to return error code on ->confirm() Greg KH
2010-11-19 21:43 ` [24/45] p54usb: fix off-by-one on !CONFIG_PM Greg KH
2010-11-19 21:43 ` [25/45] p54usb: add five more USBIDs Greg KH
2010-11-19 21:43 ` [26/45] drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure Greg KH
2010-11-19 21:43 ` [27/45] USB: ftdi_sio: Add PID for accesio products Greg KH
2010-11-19 21:43 ` [28/45] USB: add PID for FTDI based OpenDCC hardware Greg KH
2010-11-19 21:43 ` [29/45] USB: ftdi_sio: new VID/PIDs for various Papouch devices Greg KH
2010-11-19 21:43 ` [30/45] USB: ftdi_sio: add device ids for ScienceScope Greg KH
2010-11-19 21:43 ` [31/45] usb: musb: blackfin: call gpio_free() on error path in musb_platform_init() Greg KH
2010-11-19 21:43 ` [32/45] USB: option: Add more ZTE modem USB ids Greg KH
2010-11-19 21:43 ` [33/45] USB: cp210x: Add Renesas RX-Stick device ID Greg KH
2010-11-19 21:43 ` [34/45] USB: cp210x: Add WAGO 750-923 Service Cable " Greg KH
2010-11-19 21:43 ` [35/45] USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled Greg KH
2010-11-22  9:08   ` Nicolas Ferre
2010-11-22 21:31     ` Greg KH
2010-11-19 21:43 ` [36/45] USB: disable endpoints after unbinding interfaces, not before Greg KH
2010-11-19 21:43 ` [37/45] USB: opticon: Fix long-standing bugs in opticon driver Greg KH
2010-11-19 21:43 ` [38/45] USB: accept some invalid ep0-maxpacket values Greg KH
2010-11-19 21:43 ` [39/45] OHCI: work around for nVidia shutdown problem Greg KH
2010-11-20  2:52   ` [Stable-review] " Ben Hutchings
2010-11-20 16:51     ` Alan Stern
2010-11-22 17:55       ` Greg KH
2010-11-22 18:09         ` Alan Stern
2011-01-19 16:51         ` Alan Stern
2011-02-16 21:40           ` [stable] " Greg KH
2011-03-28 16:13   ` Andre "Osku" Schmidt
2010-11-19 21:43 ` [40/45] [SCSI] sd name space exhaustion causes system hang Greg KH
2010-11-19 21:43 ` [41/45] [SCSI] libsas: fix NCQ mixing with non-NCQ Greg KH
2010-11-19 21:43 ` [42/45] [SCSI] gdth: integer overflow in ioctl Greg KH
2010-11-19 21:43 ` [43/45] [SCSI] Fix race when removing SCSI devices Greg KH
2010-11-19 21:43 ` Greg KH [this message]
2010-11-19 21:43 ` [45/45] sgi-xp: incoming XPC channel messages can come in after the channels partition structures have been torn down Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101119214413.045797042@clark.site \
    --to=gregkh@suse.de \
    --cc=James.Bottomley@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=christof.schmitt@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox