lkml.org 
[lkml]   [2006]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] drivers/scsi : Fix proc_scsi_write to return "length" on success with remove-single-device case
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-26 08:51    [W:0.049 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site