Re: [RFC][PATCH] limit state change to SDEV_BLOCK devices in scsi_internal_device_unblock

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

 



Matthew Wilcox wrote:
> On Mon, Apr 27, 2009 at 01:09:57PM -0400, Takahiro Yasui wrote:
>> @@ -2633,9 +2633,12 @@ scsi_internal_device_unblock(struct scsi
>>  	unsigned long flags;
>>  	
>>  	/* 
>> -	 * Try to transition the scsi device to SDEV_RUNNING
>> -	 * and goose the device queue if successful.  
>> +	 * Try to transition the scsi device to SDEV_RUNNING if it is
>> +	 * SDEV_BLOCK and goose the device queue if successful.
> 
> I think the code looks good, but the edit to the comment dilutes its
> flavour somewhat.  How about just moving the comment down below the
> check, and then you don't need to edit the comment at all?

Thank you for the suggestion. I updated the patch according to your
comment.

Regards,
---
Takahiro Yasui
Hitachi Computer Products (America), Inc.


Signed-off-by: Takahiro Yasui <tyasui@xxxxxxxxxx>
---
 drivers/scsi/scsi_lib.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6.29/drivers/scsi/scsi_lib.c
===================================================================
--- linux-2.6.29.orig/drivers/scsi/scsi_lib.c
+++ linux-2.6.29/drivers/scsi/scsi_lib.c
@@ -2631,7 +2631,10 @@ scsi_internal_device_unblock(struct scsi
 	struct request_queue *q = sdev->request_queue; 
 	int err;
 	unsigned long flags;
-	
+
+	if (sdev->sdev_state != SDEV_BLOCK)
+		return 0;
+
 	/* 
 	 * Try to transition the scsi device to SDEV_RUNNING
 	 * and goose the device queue if successful.  
--
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