public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: akpm@osdl.org
To: James.Bottomley@steeleye.com
Cc: linux-scsi@vger.kernel.org, akpm@osdl.org, suzuki@in.ibm.com
Subject: [patch 01/31] drivers/scsi: fix proc_scsi_write to return "length" on success with remove-single-device case
Date: Thu, 08 Jun 2006 22:23:28 -0700	[thread overview]
Message-ID: <200606090523.k595NSAb032228@shell0.pdx.osdl.net> (raw)


From: Suzuki <suzuki@in.ibm.com>

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"

, even though the device was removed.

Signed-off-by: Suzuki K P <suzuki@in.ibm.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/scsi/scsi_proc.c |    2 ++
 1 file changed, 2 insertions(+)

diff -puN drivers/scsi/scsi_proc.c~drivers-scsi-fix-proc_scsi_write-to-return-length-on drivers/scsi/scsi_proc.c
--- devel/drivers/scsi/scsi_proc.c~drivers-scsi-fix-proc_scsi_write-to-return-length-on	2006-06-08 02:28:14.000000000 -0700
+++ devel-akpm/drivers/scsi/scsi_proc.c	2006-06-08 02:28:14.000000000 -0700
@@ -280,6 +280,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;
 	}
 
 	/*
_

             reply	other threads:[~2006-06-09  5:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-09  5:23 akpm [this message]
2006-06-09 14:07 ` [patch 01/31] drivers/scsi: fix proc_scsi_write to return "length" on success with remove-single-device case James Bottomley

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=200606090523.k595NSAb032228@shell0.pdx.osdl.net \
    --to=akpm@osdl.org \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=suzuki@in.ibm.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