From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, ohering@suse.com,
jbottomley@parallels.com, hch@infradead.org,
linux-scsi@vger.kernel.org
Cc: Olaf Hering <olaf@aepfle.de>, KY Srinivasan <kys@microsoft.com>
Subject: [PATCH RESEND 2/4] scsi: storvsc: avoid usage of WRITE_SAME
Date: Thu, 21 Feb 2013 12:04:51 -0800 [thread overview]
Message-ID: <1361477093-17549-2-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1361477093-17549-1-git-send-email-kys@microsoft.com>
From: Olaf Hering <olaf@aepfle.de>
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.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: KY Srinivasan <kys@microsoft.com>
Cc: <linux-scsi@vger.kernel.org>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/scsi/storvsc_drv.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 5ada1d0..2060509 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1156,6 +1156,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;
}
@@ -1238,6 +1240,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.
--
1.7.4.1
next prev parent reply other threads:[~2013-02-21 19:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-21 20:04 [PATCH 0/4] Drivers: scsi: storvsc K. Y. Srinivasan
2013-02-21 20:04 ` [PATCH RESEND 1/4] Drivers: scsi: storvsc: Initialize the sglist K. Y. Srinivasan
2013-02-21 20:04 ` K. Y. Srinivasan [this message]
2013-02-21 20:04 ` [PATCH 3/4] Drivers: scsi: storvsc: Restructure error handling code on command completion K. Y. Srinivasan
2013-02-21 20:04 ` [PATCH 4/4] Drivers: scsi: storvsc: Handle dynamic resizing of the device K. Y. Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1361477093-17549-2-git-send-email-kys@microsoft.com \
--to=kys@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=jbottomley@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=ohering@suse.com \
--cc=olaf@aepfle.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox