From: Suzuki <suzuki@in.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: akpm@osdl.org
Subject: [PATCH] drivers/scsi : Fix proc_scsi_write to return "length" on success with remove-single-device case
Date: Wed, 26 Apr 2006 12:25:54 +0530 [thread overview]
Message-ID: <444F197A.5020907@in.ibm.com> (raw)
Hi,
proc_scsi_write doesn't return the "length" upon successfully removing a
device; instead it returns 0. This causes commands like "echo" to redo
the write(), which ends up in something like,
$ echo "scsi remove-single-device 0 0 3 0" > /proc/scsi/scsi
"-bash: echo: write error: No such device or address"
, eventhough the device was removed.
Attached here is a patch to fix the issue.
* Fix proc_scsi_write to return "length" in remove-single-device case.
Signed-Off-by: Suzuki K P <suzuki@in.ibm.com>
--- linux-2.6.17-rc2-I/drivers/scsi/scsi_proc.c 2006-04-19
07:59:36.000000000 -0700
+++ linux-2.6.17-rc2-I/drivers/scsi/scsi_proc.new.c 2006-04-26
04:33:50.000000000 -0700
@@ -282,6 +282,8 @@ static ssize_t proc_scsi_write(struct fi
lun = simple_strtoul(p + 1, &p, 0);
err = scsi_remove_single_device(host, channel, id, lun);
+ if (!err)
+ err = length;
}
out:
Thanks,
Suzuki K P
Linux Technology Centre,
IBM Software Labs.
reply other threads:[~2006-04-26 6:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=444F197A.5020907@in.ibm.com \
--to=suzuki@in.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@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
Powered by JetHome