[PATCH] drivers/scsi : Fix proc_scsi_write to return "length" onsuccess with remove-single-device case
From: Suzuki
Date: Wed Apr 26 2006 - 02:49:18 EST
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@xxxxxxxxxx>
--- 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/