From: Bart Van Assche <bvanassche@acm.org>
To: David Milburn <dmilburn@redhat.com>
Cc: linux-scsi@vger.kernel.org, JBottomley@parallels.com
Subject: Re: [PATCH] scsi: remove device when state is changed to deleted thru sysfs
Date: Tue, 18 Dec 2012 08:51:49 +0100 [thread overview]
Message-ID: <50D02095.2080505@acm.org> (raw)
In-Reply-To: <1355786812-17908-1-git-send-email-dmilburn@redhat.com>
On 12/18/12 00:26, David Milburn wrote:
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index ce5224c..6d72abb 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -596,7 +596,7 @@ static ssize_t
> store_state_field(struct device *dev, struct device_attribute *attr,
> const char *buf, size_t count)
> {
> - int i;
> + int i, rc;
> struct scsi_device *sdev = to_scsi_device(dev);
> enum scsi_device_state state = 0;
>
> @@ -611,7 +611,11 @@ store_state_field(struct device *dev, struct device_attribute *attr,
> if (!state)
> return -EINVAL;
>
> - if (scsi_device_set_state(sdev, state))
> + if (state == SDEV_DEL) {
> + rc = device_schedule_callback(dev, sdev_store_delete_callback);
> + if (rc)
> + count = rc;
> + } else if (scsi_device_set_state(sdev, state))
> return -EINVAL;
> return count;
> }
Hello David,
And what about the "cancel" state ? I guess this means that you have
missed patch http://marc.info/?l=linux-scsi&m=135480941801843 ?
Bart.
next prev parent reply other threads:[~2012-12-18 7:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 23:26 [PATCH] scsi: remove device when state is changed to deleted thru sysfs David Milburn
2012-12-18 7:51 ` Bart Van Assche [this message]
2012-12-18 14:57 ` David Milburn
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=50D02095.2080505@acm.org \
--to=bvanassche@acm.org \
--cc=JBottomley@parallels.com \
--cc=dmilburn@redhat.com \
--cc=linux-scsi@vger.kernel.org \
/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).