From: Wei Fang <fangwei1@huawei.com>
To: Bart Van Assche <Bart.VanAssche@sandisk.com>,
"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"tyasui@redhat.com" <tyasui@redhat.com>
Subject: Re: [PATCH] scsi: avoid a permanent stop of the scsi device's request queue
Date: Wed, 7 Dec 2016 11:41:11 +0800 [thread overview]
Message-ID: <584784D7.1070009@huawei.com> (raw)
In-Reply-To: <BLUPR02MB168364C1D3A8A2C7CF367D5481850@BLUPR02MB1683.namprd02.prod.outlook.com>
Hi, Bart,
On 2016/12/7 10:45, Bart Van Assche wrote:
> On 12/06/16 17:21, Wei Fang wrote:
>> The state of the scsi device first is changed to SDEV_BLOCK in
>> scsi_add_lun() as you mentioned, then it will be changed to SDEV_RUNNING
>> in scsi_sysfs_add_sdev().
>
> Hello Wei,
>
> The purpose of the scsi_device_set_state(sdev, SDEV_RUNNING) call in
> scsi_sysfs_add_sdev() is to change the device state from SDEV_CREATED
> into SDEV_RUNNING. Have you tried to modify scsi_sysfs_add_sdev() such
> that it only changes the device state into SDEV_RUNNING if the current
> state is SDEV_CREATED and also such that it changes SDEV_CREATED_BLOCK
> into SDEV_BLOCK?
Does those code in scsi_add_lun() have done this thing?
...
ret = scsi_device_set_state(sdev, SDEV_RUNNING);
if (ret) {
ret = scsi_device_set_state(sdev, SDEV_BLOCK);
...
}
...
You mean we shouldn't change the device state from SDEV_BLOCK
into SDEV_RUNNING in scsi_sysfs_add_sdev()?
I thought it doesn't matter that the state is changed from SDEV_BLOCK
to SDEV_RUNNING in scsi_sysfs_add_sdev(), if the queue can be unblocked
in scsi_internal_device_unblock() in SDEV_RUNNING state. But it
was broken since commit 5c10e63c943b.
Thanks,
Wei
next prev parent reply other threads:[~2016-12-07 3:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 9:12 [PATCH] scsi: avoid a permanent stop of the scsi device's request queue Wei Fang
2016-12-06 15:51 ` Bart Van Assche
2016-12-07 1:20 ` Wei Fang
2016-12-07 2:45 ` Bart Van Assche
2016-12-07 3:41 ` Wei Fang [this message]
2016-12-07 4:40 ` Bart Van Assche
2016-12-07 6:59 ` Wei Fang
2016-12-07 16:48 ` Bart Van Assche
2016-12-07 16:55 ` Bart Van Assche
2016-12-07 17:40 ` Ewan D. Milne
2016-12-07 18:16 ` James Bottomley
2016-12-07 19:24 ` Ewan D. Milne
2016-12-07 20:09 ` James Bottomley
2016-12-07 20:30 ` Ewan D. Milne
2016-12-07 23:43 ` James Bottomley
2016-12-08 2:28 ` Wei Fang
2016-12-08 2:33 ` James Bottomley
2016-12-08 3:22 ` Wei Fang
2016-12-08 6:38 ` Wei Fang
2016-12-08 14:04 ` Ewan D. Milne
2016-12-08 15:39 ` James Bottomley
2016-12-09 1:08 ` Wei Fang
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=584784D7.1070009@huawei.com \
--to=fangwei1@huawei.com \
--cc=Bart.VanAssche@sandisk.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=tyasui@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).