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 <[email protected]>
--- 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]