Re: [PATCH 6/6] scsi: return EAGAIN when resetting a device under EH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14-11-06 04:46 PM, Elliott, Robert (Server Storage) wrote:


-----Original Message-----
From: Christoph Hellwig [mailto:hch@xxxxxx]
Sent: Thursday, 30 October, 2014 4:27 AM
To: linux-scsi@xxxxxxxxxxxxxxx
Cc: Douglas Gilbert; Elliott, Robert (Server Storage)
Subject: [PATCH 6/6] scsi: return EAGAIN when resetting a device
under EH

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
  drivers/scsi/scsi_ioctl.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 712f159..c4f7b56 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -278,7 +278,7 @@ int
scsi_ioctl_block_when_processing_errors(struct scsi_device *sdev, int
cmd,
  {
  	if (cmd == SG_SCSI_RESET && ndelay) {
  		if (scsi_host_in_recovery(sdev->host))
-			return -ENODEV;
+			return -EAGAIN;
  	} else {
  		if (!scsi_block_when_processing_errors(sdev))
  			return -ENODEV;
--
1.9.1

This is how sg_reset responds to -EAGAIN, which seems reasonable:
	sg_reset: starting device reset
	sg_reset: SG_SCSI_RESET failed: Resource temporarily unavailable

That message has been tweaked so in sg3_utils version 1.40
that will read:
   sg_reset: try again later, may be resetting now

That is easy to trigger when running sg_reset in parallel to
multiple devices presented by the same controller.  In one
example to 16 devices, 10 got that result while 6 succeeded.

Tested-by: Robert Elliott <elliott@xxxxxx>
Reviewed-by: Robert Elliott <elliott@xxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux