All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/scsi : Fix proc_scsi_write to return "length" on success with remove-single-device case
@ 2006-04-26  6:55 Suzuki
  0 siblings, 0 replies; only message in thread
From: Suzuki @ 2006-04-26  6:55 UTC (permalink / raw)
  To: lkml; +Cc: akpm

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-26  6:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-26  6:55 [PATCH] drivers/scsi : Fix proc_scsi_write to return "length" on success with remove-single-device case Suzuki

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.