Re: [PATCH RFC] sd: spin down disks on removal or power-down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Morton wrote:
triviata:

--- linux-2.6.20-rc6nv/drivers/scsi/sd.c	2007-01-28 17:00:00.000000000 -0600
+++ linux-2.6.20-rc6nvedit/drivers/scsi/sd.c	2007-01-28 18:08:53.000000000 -0600
@@ -821,6 +821,39 @@ static int sd_sync_cache(struct scsi_dev
 	return res;
 }
+static int sd_stop_unit(struct scsi_device *sdp, struct scsi_disk* sdkp)

s/* / */

+{
+	int res;
+	struct scsi_sense_hdr sshdr;
+	unsigned char cmd[10] = { 0 };

I don't think this initialisation-to-all-zeroes is needed, is it?

Pretty sure it is, the rest of the command needs to be set to 0. Without it the other 9 bytes will contain uninitialized junk.

For the other cleanup changes, though:

Signed-off-by: Robert Hancock <hancockr@xxxxxxx>

--
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@xxxxxxxxxxxxx
Home Page: http://www.roberthancock.com/



-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux