Skip to contentSkip to conversation

scsi: storvsc: avoid usage of WRITE_SAME

PATCH In review Olaf Hering 2 participants 4 messages Jan 30, 2013 – Feb 20, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: storvsc: avoid usage of WRITE_SAME

Set scsi_device->no_write_same because the host does not support it. Also blacklist WRITE_SAME to avoid (and log) accident usage.

If the guest uses the ext4 filesystem, storvsc hangs while it prints these messages in an endless loop:
...

[  161.459523] hv_storvsc vmbus_0_1: cmd 0x41 scsi status 0x2 srb status 0x6
[  161.462157] sd 2:0:0:0: [sda]
[  161.463135] Sense Key : No Sense [current]
[  161.464983] sd 2:0:0:0: [sda]
[  161.465899] Add. Sense: No additional sense information
[  161.468211] hv_storvsc vmbus_0_1: cmd 0x41 scsi status 0x2 srb status 0x6
[  161.475766] sd 2:0:0:0: [sda]
[  161.476728] Sense Key : No Sense [current]
[  161.478284] sd 2:0:0:0: [sda]
[  161.479441] Add. Sense: No additional sense information

...

This happens with a guest running on Windows Server 2012, but happens to work while running on Windows Server 2008. WRITE_SAME isnt really supported by both versions, so disable the command usage globally.

---
 drivers/scsi/storvsc_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/scsi/storvsc_drv.c +4 -0
index 0144078..314586c 100644
@@ -1155,6 +1155,8 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
 
 	blk_queue_bounce_limit(sdevice->request_queue, BLK_BOUNCE_ANY);
 
+	sdevice->no_write_same = 1;
+
 	return 0;
 }
 
@@ -1237,6 +1239,8 @@ static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd)
 	u8 scsi_op = scmnd->cmnd[0];
 
 	switch (scsi_op) {
+	/* the host does not handle WRITE_SAME, log accident usage */
+	case WRITE_SAME:
 	/*
 	 * smartd sends this command and the host does not handle
 	 * this. So, don't send it.
Signature · 1 line
1.8.1.1
#1 lore raw

James,

this patch fixes a regression in 3.8. Please try to include it in final 3.8. There is also another outstanding fix regarding sglist init from KY.

Olaf

Quoted 11 lines · Olaf Hering

Set scsi_device->no_write_same because the host does not support it. Also blacklist WRITE_SAME to avoid (and log) accident usage.

If the guest uses the ext4 filesystem, storvsc hangs while it prints these messages in an endless loop:

 drivers/scsi/storvsc_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/scsi/storvsc_drv.c +1 -0
+	sdevice->no_write_same = 1;
#2 lore raw
Quoted 21 lines

-----Original Message-----
From: Olaf Hering [mailto:[email protected]]
Sent: Monday, February 11, 2013 11:07 AM
To: [email protected]; James Bottomley
Cc: KY Srinivasan
Subject: Re: [PATCH] scsi: storvsc: avoid usage of WRITE_SAME

James,

this patch fixes a regression in 3.8. Please try to include it in final 3.8. There is also another outstanding fix regarding sglist init from KY.

Olaf

Quoted 3 lines · Olaf Hering

Set scsi_device->no_write_same because the host does not support it. Also blacklist WRITE_SAME to avoid (and log) accident usage.

Quoted 10 lines

drivers/scsi/storvsc_drv.c static int storvsc_device_configure(struct scsi_device *sdevice) · line 1158

Quoted 8 lines

If the guest uses the ext4 filesystem, storvsc hangs while it prints these messages in an endless loop:

 drivers/scsi/storvsc_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/scsi/storvsc_drv.c +1 -0
+	sdevice->no_write_same = 1;

James,

Ping. Can these make the 3.8 release.

Regards,

K. Y

#3 lore raw
In reply to Olaf Hering
Quoted 9 lines

-----Original Message-----
From: Olaf Hering [mailto:[email protected]]
Sent: Monday, February 11, 2013 11:07 AM
To: [email protected]; James Bottomley
Cc: KY Srinivasan
Subject: Re: [PATCH] scsi: storvsc: avoid usage of WRITE_SAME

Quoted 6 lines

James,

this patch fixes a regression in 3.8. Please try to include it in final 3.8. There is also another outstanding fix regarding sglist init from KY.

Olaf

Ping.

K. Y

Quoted 16 lines · Olaf Hering
Quoted 12 lines

Set scsi_device->no_write_same because the host does not support it. Also blacklist WRITE_SAME to avoid (and log) accident usage.

If the guest uses the ext4 filesystem, storvsc hangs while it prints these messages in an endless loop:

 drivers/scsi/storvsc_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/scsi/storvsc_drv.c +1 -0
+	sdevice->no_write_same = 1;