storvsc attaches the same virtual HDD multiple times

Bug #1397590 reported by Sergey Merzlikin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-lts-trusty (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

I'm using Ubuntu Server 14.04.1 LTS as client on Microsoft Hyper-V host which is Windows Server 2008 R2 SP1 machine.
When upgrading kernel version from 3.13.0.36 to 3.13.0.37 I noticed that the same SCSI virtual HDD is recognized multiple times and attached as separate devices: sdb, sdc, sdd, ..., sdi.
Here is a piece of dmesg report when booting 3.13.0.37 kernel:

[ 6.118883] scsi 2:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.119282] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 6.119557] sd 2:0:0:0: [sda] 2097152 512-byte logical blocks: (1.07 GB/1.00 GiB)
[ 6.119756] sd 2:0:0:0: [sda] Write Protect is off
[ 6.119759] sd 2:0:0:0: [sda] Mode Sense: 0f 00 10 00
[ 6.119849] sd 2:0:0:0: [sda] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.120615] scsi3 : storvsc_host_t
[ 6.121012] scsi 3:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.122622] scsi scan: INQUIRY result too short (5), using 36
[ 6.123105] scsi scan: INQUIRY result too short (5), using 36
[ 6.123457] scsi 3:1:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.124657] hv_netvsc: hv_netvsc channel opened successfully
[ 6.124692] sda: sda1
[ 6.124750] scsi scan: INQUIRY result too short (5), using 36
[ 6.125775] scsi scan: INQUIRY result too short (5), using 36
[ 6.126111] scsi 3:2:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.126341] scsi scan: INQUIRY result too short (5), using 36
[ 6.126473] scsi scan: INQUIRY result too short (5), using 36
[ 6.126608] scsi 3:3:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.126668] sd 2:0:0:0: [sda] Attached SCSI disk
[ 6.126807] scsi scan: INQUIRY result too short (5), using 36
[ 6.126978] scsi scan: INQUIRY result too short (5), using 36
[ 6.127092] scsi 3:4:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.127281] scsi scan: INQUIRY result too short (5), using 36
[ 6.127382] scsi scan: INQUIRY result too short (5), using 36
[ 6.127499] scsi 3:5:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.127681] scsi scan: INQUIRY result too short (5), using 36
[ 6.127786] scsi scan: INQUIRY result too short (5), using 36
[ 6.127900] scsi 3:6:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.128076] scsi scan: INQUIRY result too short (5), using 36
[ 6.128180] scsi scan: INQUIRY result too short (5), using 36
[ 6.128299] scsi 3:7:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.128479] scsi scan: INQUIRY result too short (5), using 36
[ 6.128583] scsi scan: INQUIRY result too short (5), using 36
[ 6.129085] sd 3:0:0:0: Attached scsi generic sg2 type 0
[ 6.129321] sd 3:0:0:0: [sdb] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 6.129654] sd 3:1:0:0: Attached scsi generic sg3 type 0
[ 6.129901] sd 3:1:0:0: [sdc] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 6.130071] sd 3:2:0:0: Attached scsi generic sg4 type 0
[ 6.130167] sd 3:0:0:0: [sdb] Write Protect is off
[ 6.130171] sd 3:0:0:0: [sdb] Mode Sense: 0f 00 10 00
[ 6.130457] sd 3:3:0:0: Attached scsi generic sg5 type 0
[ 6.130707] sd 3:0:0:0: [sdb] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.130712] sd 3:1:0:0: [sdc] Write Protect is off
[ 6.130715] sd 3:1:0:0: [sdc] Mode Sense: 0f 00 10 00
[ 6.130926] sd 3:4:0:0: Attached scsi generic sg6 type 0
[ 6.131339] sd 3:1:0:0: [sdc] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.131662] sd 3:5:0:0: Attached scsi generic sg7 type 0
[ 6.131886] sd 3:6:0:0: Attached scsi generic sg8 type 0
[ 6.132000] sd 3:2:0:0: [sdd] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 6.132106] sd 3:7:0:0: Attached scsi generic sg9 type 0
[ 6.132640] sd 3:3:0:0: [sde] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 6.132903] sd 3:2:0:0: [sdd] Write Protect is off
[ 6.132907] sd 3:2:0:0: [sdd] Mode Sense: 0f 00 10 00
[ 6.133439] sd 3:2:0:0: [sdd] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.133661] sd 3:3:0:0: [sde] Write Protect is off
[ 6.133664] sd 3:3:0:0: [sde] Mode Sense: 0f 00 10 00
[ 6.133950] sd 3:4:0:0: [sdf] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 6.134218] sd 3:3:0:0: [sde] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.134658] sd 3:4:0:0: [sdf] Write Protect is off
[ 6.134661] sd 3:4:0:0: [sdf] Mode Sense: 0f 00 10 00
[ 6.135189] sd 3:4:0:0: [sdf] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.136335] sd 3:5:0:0: [sdg] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 6.136425] sd 3:6:0:0: [sdh] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 6.136580] sd 3:5:0:0: [sdg] Write Protect is off
[ 6.136584] sd 3:5:0:0: [sdg] Mode Sense: 0f 00 10 00
[ 6.136736] sd 3:5:0:0: [sdg] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.136743] sd 3:6:0:0: [sdh] Write Protect is off
[ 6.136747] sd 3:6:0:0: [sdh] Mode Sense: 0f 00 10 00
[ 6.137173] sd 3:6:0:0: [sdh] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.138982] sdb: sdb1 sdb2
[ 6.138986] sdc: sdc1 sdc2
[ 6.139185] sd 3:7:0:0: [sdi] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 6.139671] sd 3:7:0:0: [sdi] Write Protect is off
[ 6.139674] sd 3:7:0:0: [sdi] Mode Sense: 0f 00 10 00
[ 6.139828] sd 3:7:0:0: [sdi] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.140112] sd 3:0:0:0: [sdb] Attached SCSI disk
[ 6.140116] sd 3:1:0:0: [sdc] Attached SCSI disk
[ 6.147631] hv_netvsc vmbus_0_9: Device MAC 00:15:5d:01:36:03 link state up
[ 6.149689] sdg: sdg1 sdg2
[ 6.149742] sde: sde1 sde2
[ 6.149773] sdi: sdi1 sdi2
[ 6.150282] hv_netvsc: hv_netvsc channel opened successfully
[ 6.150413] sdf: sdf1 sdf2
[ 6.150448] sdh: sdh1 sdh2
[ 6.150835] sdd: sdd1 sdd2
[ 6.152237] sd 3:6:0:0: [sdh] Attached SCSI disk
[ 6.152276] sd 3:4:0:0: [sdf] Attached SCSI disk
[ 6.152371] sd 3:2:0:0: [sdd] Attached SCSI disk
[ 6.152517] sd 3:3:0:0: [sde] Attached SCSI disk
[ 6.152537] sd 3:5:0:0: [sdg] Attached SCSI disk
[ 6.152545] sd 3:7:0:0: [sdi] Attached SCSI disk
[ 6.204673] hv_netvsc vmbus_0_10: Device MAC 00:15:5d:01:36:04 link state up
[ 6.229274] random: nonblocking pool is initialized
[ 6.400669] EXT4-fs (sdh2): mounted filesystem with ordered data mode. Opts: (null)

Note, that I use two virtual HDDs: one IDE mounted as /boot and one SCSI mounted as /. IDE HDD recognized correctly.

The same piece of dmesg when booting 3.13.0-36 kernel looks like:

[ 6.395402] scsi 2:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.396193] sd 2:0:0:0: [sda] 2097152 512-byte logical blocks: (1.07 GB/1.00 GiB)
[ 6.396404] sd 2:0:0:0: [sda] Write Protect is off
[ 6.396409] sd 2:0:0:0: [sda] Mode Sense: 0f 00 10 00
[ 6.396541] sd 2:0:0:0: [sda] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.396895] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 6.398751] hv_netvsc: hv_netvsc channel opened successfully
[ 6.399441] sda: sda1
[ 6.401185] sd 2:0:0:0: [sda] Attached SCSI disk
[ 6.423093] hv_netvsc vmbus_0_10: Device MAC 00:15:5d:01:36:04 link state up
[ 6.425530] scsi3 : storvsc_host_t
[ 6.425954] scsi 3:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4
[ 6.426243] sd 3:0:0:0: Attached scsi generic sg2 type 0
[ 6.426455] sd 3:0:0:0: [sdb] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 6.426587] sd 3:0:0:0: [sdb] Write Protect is off
[ 6.426591] sd 3:0:0:0: [sdb] Mode Sense: 0f 00 10 00
[ 6.426680] sd 3:0:0:0: [sdb] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6.440294] sdb: sdb1 sdb2
[ 6.441930] sd 3:0:0:0: [sdb] Attached SCSI disk
[ 6.598784] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)

Complete dmesg files are in attachment.
I tried newer kernels - 3.13.0.40 and 3.16.0.25 with the same result. Also I noticed that the same bug is present in Fedora 20.
The bug is not present if Hyper-V host is Windows 8 (except messages "INQUIRY result too short").

Nevertheless, the system with this bug is bootable and workable. The only problem I noticed is that update-grub recognizes Linux on each attached extra virtual disk and creates unbootable grub.cfg.

Tags: cherry-pick
Revision history for this message
Sergey Merzlikin (sm-smsoft) wrote :
Revision history for this message
Kylie Liang (kyliel) wrote :

I think this is a known issue.
Copy KY and Dexuan.

Revision history for this message
Dexuan Cui (decui) wrote :

This is a known issue (e.g., see https://bugzilla.oracle.com/bugzilla/show_bug.cgi?id=14640) we're working on:

Looks the below commit is causing the issue on WS 2008 R2 (2012 R2 is OK):

From 505216ebc571ea906445f5d50d9660ac73b26bac Mon Sep 17 00:00:00 2001
From: K. Y. Srinivasan <email address hidden>
Date: Wed, 9 Jul 2014 18:17:13 -0700
Subject: [PATCH V3 1/7] Drivers: scsi: storvsc: Change the limits to reflect
the values on the host

Revision history for this message
Dexuan Cui (decui) wrote :

KY is trying to make a bunch of fixes to the storvsc driver. This one will be addressed.

Revision history for this message
Dexuan Cui (decui) wrote :

The patch has been sent out.

From d4e9952a49981e70344692494fd33e254e4eebf5 Mon Sep 17 00:00:00 2001
From: K. Y. Srinivasan <email address hidden>
Date: Mon, 15 Dec 2014 16:49:26 -0800
Subject: [PATCH 3/4] Drivers: scsi: storvsc: Fix a bug in storvsc limits

Commit 4cd83ecdac20d30725b4f96e5d7814a1e290bc7e changed the limits to
reflect the values on the host. It turns out that WS2008R2 cannot
correctly handle these new limits. Fix this bug by setting the limits
based on the host.

Signed-off-by: K. Y. Srinivasan <email address hidden>
---
 drivers/scsi/storvsc_drv.c | 15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index a7163c6..fdc5164 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1782,6 +1782,9 @@ static int storvsc_probe(struct hv_device *device,
        bool dev_is_ide = ((dev_id->driver_data == IDE_GUID) ? true : false);
        int target = 0;
        struct storvsc_device *stor_device;
+ int max_luns_per_target;
+ int max_targets;
+ int max_channels;

        /*
         * Based on the windows host we are running on,
@@ -1795,12 +1798,18 @@ static int storvsc_probe(struct hv_device *device,
                vmscsi_size_delta = sizeof(struct vmscsi_win8_extension);
                vmstor_current_major = VMSTOR_WIN7_MAJOR;
                vmstor_current_minor = VMSTOR_WIN7_MINOR;
+ max_luns_per_target = STORVSC_IDE_MAX_LUNS_PER_TARGET;
+ max_targets = STORVSC_IDE_MAX_TARGETS;
+ max_channels = STORVSC_IDE_MAX_CHANNELS;
                break;
        default:
                sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE;
                vmscsi_size_delta = 0;
                vmstor_current_major = VMSTOR_WIN8_MAJOR;
                vmstor_current_minor = VMSTOR_WIN8_MINOR;
+ max_luns_per_target = STORVSC_MAX_LUNS_PER_TARGET;
+ max_targets = STORVSC_MAX_TARGETS;
+ max_channels = STORVSC_MAX_CHANNELS;
                break;
        }

@@ -1848,9 +1857,9 @@ static int storvsc_probe(struct hv_device *device,
                break;

        case SCSI_GUID:
- host->max_lun = STORVSC_MAX_LUNS_PER_TARGET;
- host->max_id = STORVSC_MAX_TARGETS;
- host->max_channel = STORVSC_MAX_CHANNELS - 1;
+ host->max_lun = max_luns_per_target;
+ host->max_id = max_targets;
+ host->max_channel = max_channels - 1;
                break;

        default:
--

Revision history for this message
Sergey Merzlikin (sm-smsoft) wrote :

I applied the whole set of four patches mentioned above to a kernel 3.13.0-44.73, and can say that the problem resolved.
The behaviour became the same as with kernel 3.13.0-36 (with Windows 2008R2 as a host), and no changes in behaviour noticed with Windows 8.1 as a host.

penalvch (penalvch)
tags: added: cherry-pick
Changed in linux-lts-trusty (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.