From: Takahiro Yasui <tyasui@redhat.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-scsi@vger.kernel.org, mchristi@redhat.com, mbarrow@redhat.com
Subject: Re: [RFC][PATCH] limit state change to SDEV_BLOCK devices in scsi_internal_device_unblock
Date: Mon, 27 Apr 2009 15:43:09 -0400 [thread overview]
Message-ID: <49F60ACD.5030204@redhat.com> (raw)
In-Reply-To: <20090427180300.GH1926@parisc-linux.org>
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@redhat.com>
---
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.
next prev parent reply other threads:[~2009-04-27 19:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-27 17:09 [RFC][PATCH] limit state change to SDEV_BLOCK devices in scsi_internal_device_unblock Takahiro Yasui
2009-04-27 18:03 ` Matthew Wilcox
2009-04-27 19:43 ` Takahiro Yasui [this message]
2009-04-27 20:08 ` James Bottomley
2009-04-27 23:52 ` Takahiro Yasui
2009-04-28 2:31 ` Matthew Wilcox
2009-04-28 2:51 ` Takahiro Yasui
2009-04-28 3:27 ` Takahiro Yasui
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=49F60ACD.5030204@redhat.com \
--to=tyasui@redhat.com \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=mbarrow@redhat.com \
--cc=mchristi@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.