public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* scsi: only re-lock door after EH on devices that were reset
@ 2014-11-03 18:36 Christoph Hellwig
  2014-11-05  1:57 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2014-11-03 18:36 UTC (permalink / raw)
  To: linux-scsi
  Cc: Meelis Roos, James Bottomley, Hannes Reinecke, Martin K. Petersen

Setups that use the blk-mq I/O path can lock up if a host with a single
device that has its door locked enters EH.  Make sure to only send the
command to re-lock the door to devices that actually were reset and thus
might have lost their state.  Otherwise the EH code might be get blocked
on blk_get_request as all requests for non-reset devices might be in use.

Cc: stable@vger.kernel.org
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Meelis Roos <meelis.roos@ut.ee>
Tested-by: Meelis Roos <meelis.roos@ut.ee>

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index fa7b5ec..7af43cb 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -2016,8 +2016,10 @@ static void scsi_restart_operations(struct Scsi_Host *shost)
 	 * is no point trying to lock the door of an off-line device.
 	 */
 	shost_for_each_device(sdev, shost) {
-		if (scsi_device_online(sdev) && sdev->locked)
+		if (scsi_device_online(sdev) && sdev->was_reset && sdev->locked) {
 			scsi_eh_lock_door(sdev);
+			sdev->was_reset = 0;
+		}
 	}
 
 	/*

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: scsi: only re-lock door after EH on devices that were reset
  2014-11-03 18:36 scsi: only re-lock door after EH on devices that were reset Christoph Hellwig
@ 2014-11-05  1:57 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2014-11-05  1:57 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-scsi, Meelis Roos, James Bottomley, Hannes Reinecke,
	Martin K. Petersen

>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:

Christoph> Setups that use the blk-mq I/O path can lock up if a host
Christoph> with a single device that has its door locked enters EH.
Christoph> Make sure to only send the command to re-lock the door to
Christoph> devices that actually were reset and thus might have lost
Christoph> their state.  Otherwise the EH code might be get blocked on
Christoph> blk_get_request as all requests for non-reset devices might
Christoph> be in use.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-05  1:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03 18:36 scsi: only re-lock door after EH on devices that were reset Christoph Hellwig
2014-11-05  1:57 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox