diff mbox

SCSI regression in 4.11

Message ID 20170228172532.280811ed@xeon-e3 (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Stephen Hemminger March 1, 2017, 1:25 a.m. UTC
> Let's concentrate on INQUIRY since that's the first command in the
> probe sequence.  I think it's completing successfully because your
> hyperv layer says it has 36 bytes of transfer and that's the size of a
> successful initial INQUIRY, so the fact that the code above would break
> stuff if the INQUIRY failed is orthogonal to the the current problem.

Right, that bodge only breaks some minor things likes scsiinfo commands.

> can you print out some of the DMA buffer in storvsc_on_io_completion()?
> 
> I think just the stor_pkt->vm_srb.cdb[0] (to identify the command
> completing) and byte 5 of the buffer will tell us what we need to know.
>  It's going to be complex to get byte 5, you'll need to do a
> kmap_atomic_pfn on request->payload->range.pfn_array[0] and then look
> at byte 5.  If that's zero it means there's some problem with hyperv
> writing to the pfn if it's 0x24 (expected value for an initial inquiry)
> we've got a problem somewhere in bio completion not copying the value
> back.

Here is another boot, this time went dumpster diving as you suggested
to get the request data.




Which results in:
...

[    1.225501] scsi host0: storvsc_host_t
[    1.234707] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.235517] scsi host1: storvsc_host_t
[    1.238037] inquiry data: 00000000: 00 23 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.256800] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.259430] inquiry data: 00000020: 00 00 00 00
[    1.261431] scsi 0:0:0:0: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[    1.264080] hv_storvsc:  IO cmd 0x12 0x1 0x0 scsi status 0x0 srb status 0x1 length 12
[    1.267420] inquiry data: 00000000: 00 00 00 08 00 83 8f b0 b1 b2 ce cf
[    1.270759] hv_storvsc:  IO cmd 0x12 0x1 0x83 scsi status 0x0 srb status 0x1 length 52
[    1.275007] inquiry data: 00000000: 00 83 00 30 01 01 00 18 4d 53 46 54 20 20 20 20
[    1.277988] inquiry data: 00000010: 43 77 cc 85 5f 19 c2 46 ac 48 c7 33 b9 dd 2d 2a
[    1.281096] inquiry data: 00000020: 01 03 00 10 60 02 24 80 43 77 cc 85 5f 19 c7 33
[    1.284246] inquiry data: 00000030: b9 dd 2d 2a
[    1.306538] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.310621] inquiry data: 00000000: 00 92 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.316244] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.328151] random: fast init done
[    1.340184] inquiry data: 00000020: 00 00 00 00
[    1.342710] scsi 1:0:0:0: CD-ROM            Msft     Virtual DVD-ROM  1.0  PQ: 0 ANSI: 0
[    1.346023] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.352913] inquiry data: 00000000: 00 aa be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.356543] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.359996] inquiry data: 00000020: 00 00 00 00
[    1.361835] scsi host1: scsi scan: INQUIRY result too short (5), using 36
[    1.361888] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 16
[    1.362307] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.362308] inquiry data: 00000000: 00 23 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.362309] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.362309] inquiry data: 00000020: 00 00 00 00
[    1.377423] scsi 1:0:0:1: Direct-Access                                    PQ: 0 ANSI: 0
[    1.399208] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.402836] inquiry data: 00000000: 00 a3 be f1 5c 98 ff ff 00 00 00 00 00 00 00 00
[    1.406466] inquiry data: 00000010: 00 00 00 00 00 00 00 00 c0 30 66 f9 5c 98 ff ff
[    1.409766] inquiry data: 00000020: 00 00 00 00
[    1.412366] scsi 1:0:0:2: Direct-Access                                    PQ: 0 ANSI: 0
[    1.412456] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.418750] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.421624] inquiry data: 00000000: 00 92 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.424629] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.432565] inquiry data: 00000020: 00 00 00 00
[    1.433690] scsi 1:0:0:3: Direct-Access                                    PQ: 0 ANSI: 0
[    1.433751] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.433753] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.433753] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.433753] inquiry data: 00000020: 00 00 00 00
[    1.465775] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.468640] inquiry data: 00000000: 00 92 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.471717] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.474466] inquiry data: 00000020: 00 00 00 00
[    1.476624] scsi 1:0:0:4: Direct-Access                                    PQ: 0 ANSI: 0
[    1.476777] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.482802] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.485801] inquiry data: 00000000: 00 92 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.493743] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.495724] inquiry data: 00000020: 00 00 00 00
[    1.497451] scsi 1:0:0:5: Direct-Access                                    PQ: 0 ANSI: 0
[    1.497557] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.497558] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.497559] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.497559] inquiry data: 00000020: 00 00 00 00
[    1.529199] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.532055] inquiry data: 00000000: 00 a3 be f1 5c 98 ff ff 00 00 00 00 00 00 00 00
[    1.535076] inquiry data: 00000010: 00 00 00 00 00 00 00 00 c0 30 66 f9 5c 98 ff ff
[    1.537601] inquiry data: 00000020: 00 00 00 00
[    1.539463] scsi 1:0:0:6: Direct-Access                                    PQ: 0 ANSI: 0
[    1.539523] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.545625] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.549238] inquiry data: 00000000: 00 00 00 00 00 00 00 00 f0 64 02 89 ff ff ff ff
[    1.558838] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.561775] inquiry data: 00000020: 00 00 00 00
[    1.564193] scsi 1:0:0:7: Direct-Access                                    PQ: 0 ANSI: 0
[    1.564286] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.564287] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.564288] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.564288] inquiry data: 00000020: 00 00 00 00
[    1.591962] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.594803] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.597613] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.600483] inquiry data: 00000020: 00 00 00 00
[    1.602473] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.602979] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.605686] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.608562] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.612031] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.621398] inquiry data: 00000020: 00 00 00 00
[    1.623612] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.624081] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.627608] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.627608] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.627608] inquiry data: 00000020: 00 00 00 00
[    1.656428] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.659541] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.662333] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.665187] inquiry data: 00000020: 00 00 00 00
[    1.666998] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.670735] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.673517] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.677515] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.677515] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.677515] inquiry data: 00000020: 00 00 00 00
[    1.690656] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.694467] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.697643] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.700563] inquiry data: 00000020: 00 00 00 00
[    1.702595] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.702962] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.726145] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.729919] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.733720] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.736863] inquiry data: 00000020: 00 00 00 00
[    1.740093] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.740194] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.744076] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.744076] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.744076] inquiry data: 00000020: 00 00 00 00
[    1.772956] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.776953] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.779680] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.782218] inquiry data: 00000020: 00 00 00 00
[    1.784394] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.784626] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.792094] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.795247] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.797827] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.802734] inquiry data: 00000020: 00 00 00 00
[    1.819848] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.820240] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.823843] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.823843] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.823843] inquiry data: 00000020: 00 00 00 00
[    1.834404] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.834447] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.840676] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.843780] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.846374] inquiry data: 00000020: 00 00 00 00
[    1.863480] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.863527] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.863552] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.863553] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.863564] inquiry data: 00000020: 00 00 00 00
[    1.884017] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.884018] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.891512] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.903984] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.915662] inquiry data: 00000020: 00 00 00 00
[    1.917991] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.917998] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.924404] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.927723] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.930174] inquiry data: 00000020: 00 00 00 00
[    1.932514] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.932508] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.940019] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.956298] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.962475] inquiry data: 00000020: 00 00 00 00
[    1.965476] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.968215] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.971735] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.973634] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.975698] inquiry data: 00000020: 00 00 00 00
[    1.977125] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.979795] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    1.981025] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.982616] inquiry data: 00000020: 00 00 00 00
[    1.984502] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    1.984717] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    2.008517] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    2.011539] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    2.013973] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    2.016679] inquiry data: 00000020: 00 00 00 00
[    2.018610] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    2.018823] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    2.024671] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    2.027955] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    2.030679] inquiry data: 00000020: 00 00 00 00
[    2.033142] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    2.042496] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    2.056213] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    2.059225] inquiry data: 00000020: 00 00 00 00
[    2.060987] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    2.061371] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    2.086089] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    2.088962] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    2.091849] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    2.094272] inquiry data: 00000020: 00 00 00 00
[    2.096274] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    2.096535] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    2.100269] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    2.100269] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    2.100269] inquiry data: 00000020: 00 00 00 00
[    2.109952] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    2.112806] inquiry data: 00000000: 00 b3 be f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    2.121465] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    2.124358] inquiry data: 00000020: 00 00 00 00
[    2.126483] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    2.126840] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    2.134173] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    2.136972] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    2.140007] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    2.142548] inquiry data: 00000020: 00 00 00 00
[    2.152163] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    2.165698] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    2.169146] inquiry data: 00000000: 00 2d 34 f1 5c 98 ff ff f0 64 02 89 ff ff ff ff
[    2.169694] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    2.169694] inquiry data: 00000020: 00 00 00 00
[    2.181106] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb status 0x1 length 4096
[    2.184852] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x0 srb status 0x1 length 0
[    2.184927] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    2.185119] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x2 srb status 0x84 length 0
[    2.185170] hv_storvsc:  IO cmd 0x1a 0x0 0x2a scsi status 0x2 srb status 0x6 length 128
[    2.185189] sr 1:0:0:0: [sr0] scsi3-mmc drive: 0x/0x caddy
[    2.185190] cdrom: Uniform CD-ROM driver Revision: 3.20
[    2.185427] hv_storvsc:  IO cmd 0x4a 0x1 0x0 scsi status 0x0 srb status 0x1 length 8
[    2.185471] sr 1:0:0:0: Attached scsi generic sg1 type 5
[    2.185622] hv_storvsc:  IO cmd 0x4a 0x1 0x0 scsi status 0x0 srb status 0x1 length 8
[    2.185666] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x0 srb status 0x20 length 8
[    2.185673] sd 1:0:0:1: Attached scsi generic sg2 type 0
[    2.185722] hv_storvsc:  IO cmd 0x25 0x0 0x0 scsi status 0x0 srb status 0x20 length 8
[    2.185816] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x2 srb status 0x84 length 0
[    2.185851] sd 1:0:0:1: [sdb] Sector size 0 reported, assuming 512.
[    2.185853] sd 1:0:0:1: [sdb] 1 512-byte logical blocks: (512 B/512 B)
[    2.185854] sd 1:0:0:1: [sdb] 0-byte physical blocks
[    2.185860] hv_storvsc:  IO cmd 0x1a 0x0 0x3f scsi status 0x0 srb status 0x20 length 4
[    2.185865] sd 1:0:0:2: Attached scsi generic sg3 type 0
[    2.185979] sd 1:0:0:1: [sdb] Write Protect is off
[    2.186030] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x2 srb status 0x84 length 0
[    2.186038] hv_storvsc:  IO cmd 0x1a 0x0 0x8 scsi status 0x0 srb status 0x20 length 4
[    2.186247] sd 1:0:0:1: [sdb] Asking for cache data failed
[    2.186247] sd 1:0:0:1: [sdb] Assuming drive cache: write through
[    2.186603] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x0 srb status 0x20 length 4
[    2.186637] hv_storvsc:  IO cmd 0x25 0x0 0x0 scsi status 0x0 srb status 0x20 length 8
[    2.186686] sd 1:0:0:1: [sdb] Sector size 0 reported, assuming 512.
[    2.186665] hv_storvsc:  IO cmd 0x1a 0x0 0x3f scsi status 0x0 srb status 0x20 length 4
[    2.186685] hv_storvsc:  IO cmd 0x1a 0x0 0x8 scsi status 0x0 srb status 0x20 length 4
[    2.186771] sd 1:0:0:3: Attached scsi generic sg4 type 0
[    2.186849] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x0 srb status 0x20 length 8
[    2.186861] hv_storvsc:  IO cmd 0x25 0x0 0x0 scsi status 0x0 srb status 0x20 length 8
[    2.186965] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x0 srb status 0x20 length 0
[    2.187002] hv_storvsc:  IO cmd 0x25 0x0 0x0 scsi status 0x0 srb status 0x20 length 8
[    2.186990] hv_storvsc:  IO cmd 0x28 0x0 0x0 scsi status 0x0 srb status 0x20 length 512
[    2.186999] sd 1:0:0:4: Attached scsi generic sg5 type 0
[    2.187023] sd 1:0:0:3: [sdd] Sector size 0 reported, assuming 512.
[    2.187025] sd 1:0:0:3: [sdd] 1 512-byte logical blocks: (512 B/512 B)
[    2.187026] sd 1:0:0:3: [sdd] 0-byte physical blocks
[    2.187073] hv_storvsc:  IO cmd 0x1a 0x0 0x3f scsi status 0x0 srb status 0x20 length 4
[    2.187054] sd 1:0:0:3: [sdd] Write Protect is off
[    2.187106] hv_storvsc:  IO cmd 0x1a 0x0 0x8 scsi status 0x0 srb status 0x20 length 4
[    2.187225] sd 1:0:0:3: [sdd] Asking for cache data failed
[    2.187226] sd 1:0:0:3: [sdd] Assuming drive cache: write through
[    2.187267] sd 1:0:0:5: Attached scsi generic sg6 type 0
[    2.187579] hv_storvsc:  IO cmd 0x4a 0x1 0x0 scsi status 0x0 srb status 0x1 length 8
[    2.187613] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x2 srb status 0x84 length 0
[    2.187644] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    2.187645] inquiry data: 00000000: 05 80 00 02 1f 00 00 00 4d 73 66 74 20 20 20 20
[    2.187646] inquiry data: 00000010: 56 69 72 74 75 61 6c 20 44 56 44 2d 52 4f 4d 20
[    2.187646] inquiry data: 00000020: 31 2e 30 20
[    2.187751] sd 1:0:0:2: [sdc] Sector size 0 reported, assuming 512.
[    2.187695] sd 1:0:0:6: Attached scsi generic sg7 type 0
[    2.187754] sd 1:0:0:2: [sdc] 1 512-byte logical blocks: (512 B/512 B)
[    2.187762] sd 1:0:0:2: [sdc] 0-byte physical blocks
[    2.187786] hv_storvsc:  IO cmd 0x4a 0x1 0x0 scsi status 0x0 srb status 0x1 length 8
[    2.187786] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x0 srb status 0x20 length 4
[    2.187746] hv_storvsc:  IO cmd 0x1a 0x0 0x3f scsi status 0x0 srb status 0x20 length 4
[    2.187790] hv_storvsc:  IO cmd 0x0 0x0 0x0 scsi status 0x2 srb status 0x84 length 0
[    2.187841] sd 1:0:0:2: [sdc] Write Protect is off
[    2.187796] hv_storvsc:  IO cmd 0x1a 0x0 0x8 scsi status 0x0 srb status 0x20 length 4
[    2.187799] hv_storvsc:  IO cmd 0x12 0x1 0x0 scsi status 0x0 srb status 0x1 length 6
[    2.187800] inquiry data: 00000000: 05 00 00 02 00 83
[    2.187893] sd 1:0:0:2: [sdc] Asking for cache data failed
[    2.187894] sd 1:0:0:2: [sdc] Assuming drive cache: write through
[    2.188016] hv_storvsc:  IO cmd 0x25 0x0 0x0 scsi status 0x0 srb status 0x20 length 8
** 812 printk messages dropped ** [    2.211818] hv_storvsc:  IO cmd 0x28 0x0 0x0 scsi status 0x0 srb status 0x20 length 512
** 881 printk messages dropped ** [    2.217316] hv_storvsc:  IO cmd 0x28 0x0 0x0 scsi status 0x0 srb status 0x20 length 512
** 671 printk messages dropped ** [    2.222495] hv_storvsc:  IO cmd 0x28 0x0 0x0 scsi status 0x0 srb status 0x20 length 512
** 136 printk messages dropped ** [    2.223813] hv_storvsc:  IO cmd 0x28 0x0 0x0 scsi status 0x0 srb status 0x20 length 512
** 477 printk messages dropped ** [    2.227906] hv_storvsc:  IO cmd 0x28 0x0 0x0 scsi status 0x0 srb status 0x20 length 512
** 768 printk messages dropped ** [    2.232439] hv_storvsc:  IO cmd 0x28 0x0 0x0 scsi status 0x0 srb status 0x20 length 512
** 389 printk messages dropped ** [    2.234770] hv_storvsc:  IO cmd 0x28 0x0 0x0 scsi status 0x0 srb status 0x20 lengt

Comments

James Bottomley March 1, 2017, 6:20 a.m. UTC | #1
On Tue, 2017-02-28 at 17:25 -0800, Stephen Hemminger wrote:
> [    1.346023] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb
> status 0x20 length 36
> [    1.352913] inquiry data: 00000000: 00 aa be f1 5c 98 ff ff f0 64
> 02 89 ff ff ff ff
> [    1.356543] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00
> [    1.359996] inquiry data: 00000020: 00 00 00 00
> [    1.361835] scsi host1: scsi scan: INQUIRY result too short (5),
> using 36
> [    1.361888] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb
> status 0x1 length 16
> [    1.362307] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb
> status 0x1 length 36
> [    1.362308] inquiry data: 00000000: 00 23 34 f1 5c 98 ff ff f0 64
> 02 89 ff ff ff ff
> [    1.362309] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00
> [    1.362309] inquiry data: 00000020: 00 00 00 00
> [    1.377423] scsi 1:0:0:1: Direct-Access                           
>          PQ: 0 ANSI: 0

Well, this pinpoints the fault to the block uncopy, I think.  The
Inquiry data is clearly correct in the page frame, so it's not getting
copied to the scsi_execute() buffer for some reason.

James
Stephen Hemminger March 1, 2017, 6:48 a.m. UTC | #2
On Tue, 28 Feb 2017 22:20:58 -0800
James Bottomley <jejb@linux.vnet.ibm.com> wrote:

> On Tue, 2017-02-28 at 17:25 -0800, Stephen Hemminger wrote:
> > [    1.346023] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb
> > status 0x20 length 36
> > [    1.352913] inquiry data: 00000000: 00 aa be f1 5c 98 ff ff f0 64
> > 02 89 ff ff ff ff
> > [    1.356543] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00
> > 00 00 00 00 00 00
> > [    1.359996] inquiry data: 00000020: 00 00 00 00
> > [    1.361835] scsi host1: scsi scan: INQUIRY result too short (5),
> > using 36
> > [    1.361888] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb
> > status 0x1 length 16
> > [    1.362307] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb
> > status 0x1 length 36
> > [    1.362308] inquiry data: 00000000: 00 23 34 f1 5c 98 ff ff f0 64
> > 02 89 ff ff ff ff
> > [    1.362309] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00
> > 00 00 00 00 00 00
> > [    1.362309] inquiry data: 00000020: 00 00 00 00
> > [    1.377423] scsi 1:0:0:1: Direct-Access                           
> >          PQ: 0 ANSI: 0  
> 
> Well, this pinpoints the fault to the block uncopy, I think.  The
> Inquiry data is clearly correct in the page frame, so it's not getting
> copied to the scsi_execute() buffer for some reason.
> 
> James
> 

Let me know, I can run another test and dump more data.
Christoph Hellwig March 1, 2017, 3:50 p.m. UTC | #3
On Tue, Feb 28, 2017 at 10:48:45PM -0800, Stephen Hemminger wrote:
> Let me know, I can run another test and dump more data.

Could it be that we keep the old sense buffer values around because
my commit change the way how sense buffers are handled.  A while ago
I suggested this patch to fix it, so maybe you can try it:

	http://git.infradead.org/users/hch/block.git/commitdiff/148cff67b401e2229c076c0ea418712654be77e4
Stephen Hemminger March 1, 2017, 3:54 p.m. UTC | #4
On Wed, 1 Mar 2017 16:50:57 +0100
Christoph Hellwig <hch@lst.de> wrote:

> On Tue, Feb 28, 2017 at 10:48:45PM -0800, Stephen Hemminger wrote:
> > Let me know, I can run another test and dump more data.  
> 
> Could it be that we keep the old sense buffer values around because
> my commit change the way how sense buffers are handled.  A while ago
> I suggested this patch to fix it, so maybe you can try it:
> 
> 	http://git.infradead.org/users/hch/block.git/commitdiff/148cff67b401e2229c076c0ea418712654be77e4

It appears that is already in the code I am testing in linux-next...

bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
			  struct scsi_sense_hdr *sshdr)
{
	memset(sshdr, 0, sizeof(struct scsi_sense_hdr));

	if (!sense_buffer || !sb_len)
		return false;

	sshdr->response_code = (sense_buffer[0] & 0x7f);

	if (!scsi_sense_valid(sshdr))
Stephen Hemminger March 1, 2017, 4:13 p.m. UTC | #5
Dexuan has reproduced the same problem and discovered that is related to whether virtual DVD is
attached to the VM.  My VM had empty virtual DVD (offline) from the installation of the ISO.
If the DVD device is removed then the VM boots.

This makes the problem less of a catastrophic but we still need to get to root cause.
Stephen Hemminger March 1, 2017, 6:48 p.m. UTC | #6
On Tue, 28 Feb 2017 22:20:58 -0800
James Bottomley <jejb@linux.vnet.ibm.com> wrote:

> On Tue, 2017-02-28 at 17:25 -0800, Stephen Hemminger wrote:
> > [    1.346023] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb
> > status 0x20 length 36
> > [    1.352913] inquiry data: 00000000: 00 aa be f1 5c 98 ff ff f0 64
> > 02 89 ff ff ff ff
> > [    1.356543] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00
> > 00 00 00 00 00 00
> > [    1.359996] inquiry data: 00000020: 00 00 00 00
> > [    1.361835] scsi host1: scsi scan: INQUIRY result too short (5),
> > using 36
> > [    1.361888] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0 srb
> > status 0x1 length 16
> > [    1.362307] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0 srb
> > status 0x1 length 36
> > [    1.362308] inquiry data: 00000000: 00 23 34 f1 5c 98 ff ff f0 64
> > 02 89 ff ff ff ff
> > [    1.362309] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00 00
> > 00 00 00 00 00 00
> > [    1.362309] inquiry data: 00000020: 00 00 00 00
> > [    1.377423] scsi 1:0:0:1: Direct-Access                           
> >          PQ: 0 ANSI: 0  
> 
> Well, this pinpoints the fault to the block uncopy, I think.  The
> Inquiry data is clearly correct in the page frame, so it's not getting
> copied to the scsi_execute() buffer for some reason.
> 
> James
> 

Why do I see different sense data on good (4.10) versus bad (4.11)

Good 4.10 initial INQUIRY buffer
[    1.012413] data: 00000000: 00 2e 64 71 db 97 ff ff f0 94 62 96 ff ff ff ff
[    1.012413] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.012414] data: 00000020: 00 00 00 00

Bad 4.11 initial INQUIRY buffer  
[    1.218159] data: 00000000: 00 00 05 02 1f 00 00 02 4d 73 66 74 20 20 20 20
[    1.225654] data: 00000010: 56 69 72 74 75 61 6c 20 44 69 73 6b 20 20 20 20
[    1.242930] data: 00000020: 31 2e 30 20

Is the kmap_atomic looking at the right place?
James Bottomley March 1, 2017, 6:57 p.m. UTC | #7
On Wed, 2017-03-01 at 10:48 -0800, Stephen Hemminger wrote:
> On Tue, 28 Feb 2017 22:20:58 -0800
> James Bottomley <jejb@linux.vnet.ibm.com> wrote:
> 
> > On Tue, 2017-02-28 at 17:25 -0800, Stephen Hemminger wrote:
> > > [    1.346023] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0
> > > srb
> > > status 0x20 length 36
> > > [    1.352913] inquiry data: 00000000: 00 aa be f1 5c 98 ff ff f0
> > > 64
> > > 02 89 ff ff ff ff
> > > [    1.356543] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00
> > > 00
> > > 00 00 00 00 00 00
> > > [    1.359996] inquiry data: 00000020: 00 00 00 00
> > > [    1.361835] scsi host1: scsi scan: INQUIRY result too short
> > > (5),
> > > using 36
> > > [    1.361888] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0
> > > srb
> > > status 0x1 length 16
> > > [    1.362307] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0
> > > srb
> > > status 0x1 length 36
> > > [    1.362308] inquiry data: 00000000: 00 23 34 f1 5c 98 ff ff f0
> > > 64
> > > 02 89 ff ff ff ff
> > > [    1.362309] inquiry data: 00000010: 00 00 00 00 00 00 00 00 00
> > > 00
> > > 00 00 00 00 00 00
> > > [    1.362309] inquiry data: 00000020: 00 00 00 00
> > > [    1.377423] scsi 1:0:0:1: Direct-Access                       
> > >     
> > >          PQ: 0 ANSI: 0  
> > 
> > Well, this pinpoints the fault to the block uncopy, I think.  The
> > Inquiry data is clearly correct in the page frame, so it's not
> > getting
> > copied to the scsi_execute() buffer for some reason.
> > 
> > James
> > 
> 
> Why do I see different sense data on good (4.10) versus bad (4.11)
> 
> Good 4.10 initial INQUIRY buffer
> [    1.012413] data: 00000000: 00 2e 64 71 db 97 ff ff f0 94 62 96 ff
> ff ff ff
> [    1.012413] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00
> [    1.012414] data: 00000020: 00 00 00 00
> 
> Bad 4.11 initial INQUIRY buffer  
> [    1.218159] data: 00000000: 00 00 05 02 1f 00 00 02 4d 73 66 74 20
> 20 20 20
> [    1.225654] data: 00000010: 56 69 72 74 75 61 6c 20 44 69 73 6b 20
> 20 20 20
> [    1.242930] data: 00000020: 31 2e 30 20
> 
> Is the kmap_atomic looking at the right place?

Actually, the 4.11 data looks good.  You can tell from the string at
byte 8.  It's rubbish in the 4.10 one and 'Msft ' in the 4.11 one (I
assume you just reversed the cut and paste).

These should be the page physical addresses you sent down to the
hypervisor, so kmap should work.  Perhaps print out the physical page
address so we see what we're getting.

James
Linus Torvalds March 1, 2017, 7 p.m. UTC | #8
On Wed, Mar 1, 2017 at 10:48 AM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Bad 4.11 initial INQUIRY buffer
> [    1.218159] data: 00000000: 00 00 05 02 1f 00 00 02 4d 73 66 74 20 20 20 20
> [    1.225654] data: 00000010: 56 69 72 74 75 61 6c 20 44 69 73 6b 20 20 20 20
> [    1.242930] data: 00000020: 31 2e 30 20

 "........Msft    Virtual Disk    1.0 ."

in case anybody wondered about what the ascii data was, like I did.

              Linus
James Bottomley March 1, 2017, 7:20 p.m. UTC | #9
On Wed, 2017-03-01 at 10:57 -0800, James Bottomley wrote:
> On Wed, 2017-03-01 at 10:48 -0800, Stephen Hemminger wrote:
> > On Tue, 28 Feb 2017 22:20:58 -0800
> > James Bottomley <jejb@linux.vnet.ibm.com> wrote:
> > 
> > > On Tue, 2017-02-28 at 17:25 -0800, Stephen Hemminger wrote:
> > > > [    1.346023] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0
> > > > srb
> > > > status 0x20 length 36
> > > > [    1.352913] inquiry data: 00000000: 00 aa be f1 5c 98 ff ff
> > > > f0
> > > > 64
> > > > 02 89 ff ff ff ff
> > > > [    1.356543] inquiry data: 00000010: 00 00 00 00 00 00 00 00
> > > > 00
> > > > 00
> > > > 00 00 00 00 00 00
> > > > [    1.359996] inquiry data: 00000020: 00 00 00 00
> > > > [    1.361835] scsi host1: scsi scan: INQUIRY result too short
> > > > (5),
> > > > using 36
> > > > [    1.361888] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0
> > > > srb
> > > > status 0x1 length 16
> > > > [    1.362307] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0
> > > > srb
> > > > status 0x1 length 36
> > > > [    1.362308] inquiry data: 00000000: 00 23 34 f1 5c 98 ff ff
> > > > f0
> > > > 64
> > > > 02 89 ff ff ff ff
> > > > [    1.362309] inquiry data: 00000010: 00 00 00 00 00 00 00 00
> > > > 00
> > > > 00
> > > > 00 00 00 00 00 00
> > > > [    1.362309] inquiry data: 00000020: 00 00 00 00
> > > > [    1.377423] scsi 1:0:0:1: Direct-Access                     
> > > >   
> > > >     
> > > >          PQ: 0 ANSI: 0  
> > > 
> > > Well, this pinpoints the fault to the block uncopy, I think.  The
> > > Inquiry data is clearly correct in the page frame, so it's not
> > > getting
> > > copied to the scsi_execute() buffer for some reason.
> > > 
> > > James
> > > 
> > 
> > Why do I see different sense data on good (4.10) versus bad (4.11)
> > 
> > Good 4.10 initial INQUIRY buffer
> > [    1.012413] data: 00000000: 00 2e 64 71 db 97 ff ff f0 94 62 96
> > ff
> > ff ff ff
> > [    1.012413] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00
> > 00
> > 00 00 00
> > [    1.012414] data: 00000020: 00 00 00 00
> > 
> > Bad 4.11 initial INQUIRY buffer  
> > [    1.218159] data: 00000000: 00 00 05 02 1f 00 00 02 4d 73 66 74
> > 20
> > 20 20 20
> > [    1.225654] data: 00000010: 56 69 72 74 75 61 6c 20 44 69 73 6b
> > 20
> > 20 20 20
> > [    1.242930] data: 00000020: 31 2e 30 20
> > 
> > Is the kmap_atomic looking at the right place?
> 
> Actually, the 4.11 data looks good.  You can tell from the string at
> byte 8.  It's rubbish in the 4.10 one and 'Msft ' in the 4.11 one (I
> assume you just reversed the cut and paste).
> 
> These should be the page physical addresses you sent down to the
> hypervisor, so kmap should work.  Perhaps print out the physical page
> address so we see what we're getting.

Another possible explanation is non zero sg->offset, in which case you
might not see the INQUIRY data because you start at the beginning of
the page.  This shouldn't happen because you specify no alignment
override in the driver, so we should start the INQUIRY buffer on a new
page and copy the data back to the real buffer, but perhaps that's what
changed.

James
Stephen Hemminger March 1, 2017, 7:39 p.m. UTC | #10
On Wed, 01 Mar 2017 11:20:22 -0800
James Bottomley <James.Bottomley@HansenPartnership.com> wrote:

> On Wed, 2017-03-01 at 10:57 -0800, James Bottomley wrote:
> > On Wed, 2017-03-01 at 10:48 -0800, Stephen Hemminger wrote:  
> > > On Tue, 28 Feb 2017 22:20:58 -0800
> > > James Bottomley <jejb@linux.vnet.ibm.com> wrote:
> > >   
> > > > On Tue, 2017-02-28 at 17:25 -0800, Stephen Hemminger wrote:  
> > > > > [    1.346023] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0
> > > > > srb
> > > > > status 0x20 length 36
> > > > > [    1.352913] inquiry data: 00000000: 00 aa be f1 5c 98 ff ff
> > > > > f0
> > > > > 64
> > > > > 02 89 ff ff ff ff
> > > > > [    1.356543] inquiry data: 00000010: 00 00 00 00 00 00 00 00
> > > > > 00
> > > > > 00
> > > > > 00 00 00 00 00 00
> > > > > [    1.359996] inquiry data: 00000020: 00 00 00 00
> > > > > [    1.361835] scsi host1: scsi scan: INQUIRY result too short
> > > > > (5),
> > > > > using 36
> > > > > [    1.361888] hv_storvsc:  IO cmd 0xa0 0x0 0x0 scsi status 0x0
> > > > > srb
> > > > > status 0x1 length 16
> > > > > [    1.362307] hv_storvsc:  IO cmd 0x12 0x0 0x0 scsi status 0x0
> > > > > srb
> > > > > status 0x1 length 36
> > > > > [    1.362308] inquiry data: 00000000: 00 23 34 f1 5c 98 ff ff
> > > > > f0
> > > > > 64
> > > > > 02 89 ff ff ff ff
> > > > > [    1.362309] inquiry data: 00000010: 00 00 00 00 00 00 00 00
> > > > > 00
> > > > > 00
> > > > > 00 00 00 00 00 00
> > > > > [    1.362309] inquiry data: 00000020: 00 00 00 00
> > > > > [    1.377423] scsi 1:0:0:1: Direct-Access                     
> > > > >   
> > > > >     
> > > > >          PQ: 0 ANSI: 0    
> > > > 
> > > > Well, this pinpoints the fault to the block uncopy, I think.  The
> > > > Inquiry data is clearly correct in the page frame, so it's not
> > > > getting
> > > > copied to the scsi_execute() buffer for some reason.
> > > > 
> > > > James
> > > >   
> > > 
> > > Why do I see different sense data on good (4.10) versus bad (4.11)
> > > 
> > > Good 4.10 initial INQUIRY buffer
> > > [    1.012413] data: 00000000: 00 2e 64 71 db 97 ff ff f0 94 62 96
> > > ff
> > > ff ff ff
> > > [    1.012413] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00
> > > 00
> > > 00 00 00
> > > [    1.012414] data: 00000020: 00 00 00 00
> > > 
> > > Bad 4.11 initial INQUIRY buffer  
> > > [    1.218159] data: 00000000: 00 00 05 02 1f 00 00 02 4d 73 66 74
> > > 20
> > > 20 20 20
> > > [    1.225654] data: 00000010: 56 69 72 74 75 61 6c 20 44 69 73 6b
> > > 20
> > > 20 20 20
> > > [    1.242930] data: 00000020: 31 2e 30 20
> > > 
> > > Is the kmap_atomic looking at the right place?  
> > 
> > Actually, the 4.11 data looks good.  You can tell from the string at
> > byte 8.  It's rubbish in the 4.10 one and 'Msft ' in the 4.11 one (I
> > assume you just reversed the cut and paste).
> > 
> > These should be the page physical addresses you sent down to the
> > hypervisor, so kmap should work.  Perhaps print out the physical page
> > address so we see what we're getting.  
> 
> Another possible explanation is non zero sg->offset, in which case you
> might not see the INQUIRY data because you start at the beginning of
> the page.  This shouldn't happen because you specify no alignment
> override in the driver, so we should start the INQUIRY buffer on a new
> page and copy the data back to the real buffer, but perhaps that's what
> changed.

Dumping more data from 4.9, 4.10 and 4.11
Stephen Hemminger March 1, 2017, 9:27 p.m. UTC | #11
Ok here is much better data, wasn't accounting for the offset in the payload


Working 4.10
[    1.020041] scsi host0: storvsc_host_t
[    1.024998] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.027452] hv_storvsc:  payload size 288 count 1 offset 3072 len 36 pfn 0x1f15d0
[    1.029385] hv_storvsc:  sg 0: phys 0x1f15d0000 virt ffff9270b15d0000 offset 0xc00 length 36
[    1.031720] data: 00000000: 00 00 05 02 1f 00 00 02 4d 73 66 74 20 20 20 20  ........Msft    
[    1.033846] data: 00000010: 56 69 72 74 75 61 6c 20 44 69 73 6b 20 20 20 20  Virtual Disk    
[    1.036080] data: 00000020: 31 2e 30 20                                      1.0 
[    1.038249] scsi 0:0:0:0: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[    1.040394] hv_storvsc: INQUIRY cmd 0x12 0x1 0x0 scsi status 0x0 srb status 0x1 length 12
[    1.041494] scsi host1: storvsc_host_t
[    1.044683] hv_storvsc:  payload size 288 count 1 offset 0 len 255 pfn 0x1f0faf
[    1.046940] hv_storvsc:  sg 0: phys 0x1f0faf000 virt ffff9270b0faf000 offset 0x0 length 255
[    1.048555] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.048556] hv_storvsc:  payload size 288 count 1 offset 2816 len 36 pfn 0x1f15d6
[    1.048557] hv_storvsc:  sg 0: phys 0x1f15d6000 virt ffff9270b15d6000 offset 0xb00 length 36
[    1.048559] data: 00000000: 05 80 00 02 1f 00 00 00 4d 73 66 74 20 20 20 20  ........Msft    
[    1.048560] data: 00000010: 56 69 72 74 75 61 6c 20 44 56 44 2d 52 4f 4d 20  Virtual DVD-ROM 
[    1.048560] data: 00000020: 31 2e 30 20                                      1.0 
[    1.048590] scsi 1:0:0:0: CD-ROM            Msft     Virtual DVD-ROM  1.0  PQ: 0 ANSI: 0
[    1.048920] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.048920] hv_storvsc:  payload size 288 count 1 offset 1024 len 36 pfn 0x1f15d7
[    1.048921] hv_storvsc:  sg 0: phys 0x1f15d7000 virt ffff9270b15d7000 offset 0x400 length 36
[    1.048922] data: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.048923] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.048923] data: 00000020: 00 00 00 00                                      ....
[    1.048942] scsi host1: scsi scan: INQUIRY result too short (5), using 36


Broken 4.11

[    1.487930] scsi host0: storvsc_host_t
[    1.541254] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.545242] hv_storvsc:  payload size 288 count 1 offset 768 len 36 pfn 0x1f1196
[    1.545242] hv_storvsc:  sg 0: phys 0x1f1196000 virt ffff9a42f1196000 offset 0x300 length 36
[    1.545242] data: 00000000: 00 00 05 02 1f 00 00 02 4d 73 66 74 20 20 20 20  ........Msft    
[    1.545242] data: 00000010: 56 69 72 74 75 61 6c 20 44 69 73 6b 20 20 20 20  Virtual Disk    
[    1.545242] data: 00000020: 31 2e 30 20                                      1.0 
[    1.570136] scsi 0:0:0:0: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[    1.571001] scsi host1: storvsc_host_t
[    1.608793] hv_storvsc: INQUIRY cmd 0x12 0x1 0x0 scsi status 0x0 srb status 0x1 length 12
[    1.610316] hv_storvsc:  payload size 288 count 1 offset 0 len 255 pfn 0x1f0577
[    1.611749] hv_storvsc:  sg 0: phys 0x1f0577000 virt ffff9a42f0577000 offset 0x0 length 255
[    1.612788] data: 00000000: 00 00 00 08 00 83 8f b0 b1 b2 ce cf 72 65 61 74  ............reat
[    1.612788] data: 00000010: 65 5f 66 69 6c 65 00 5f 5f 63 72 63 5f 68 69 64  e_file.__crc_hid
[    1.612788] data: 00000020: 5f 72 65 70 6f 72 74 5f 72 61 77 5f 65 76 65 6e  _report_raw_even
[    1.612788] data: 00000030: 74 00 76 66 72 65 65 00 75 6e 72 65 67 69 73 74  t.vfree.unregist
[    1.612788] data: 00000040: 65 72 5f 63 68 72 64 65 76 5f 72 65 67 69 6f 6e  er_chrdev_region
[    1.612788] data: 00000050: 00 6d 75 74 65 78 5f 75 6e 6c 6f 63 6b 00 68 69  .mutex_unlock.hi
[    1.612788] data: 00000060: 64 5f 64 65 62 75 67 5f 65 78 69 74 00 6b 6d 65  d_debug_exit.kme
[    1.612788] data: 00000070: 6d 64 75 70 00 68 69 64 72 61 77 5f 65 78 69 74  mdup.hidraw_exit
[    1.612788] data: 00000080: 00 5f 5f 67 65 74 5f 75 73 65 72 5f 34 00 70 6f  .__get_user_4.po
[    1.612788] data: 00000090: 77 65 72 5f 73 75 70 70 6c 79 5f 70 6f 77 65 72  wer_supply_power
[    1.612788] data: 000000a0: 73 00 64 65 76 69 63 65 5f 64 65 73 74 72 6f 79  s.device_destroy
[    1.612788] data: 000000b0: 00 5f 5f 63 72 63 5f 68 69 64 5f 73 6e 74 6f 33  .__crc_hid_snto3
[    1.612788] data: 000000c0: 32 00 63 61 6e 63 65 6c 5f 77 6f 72 6b 5f 73 79  2.cancel_work_sy
[    1.612788] data: 000000d0: 6e 63 00 73 65 71 5f 70 72 69 6e 74 66 00 64 6f  nc.seq_printf.do
[    1.612788] data: 000000e0: 77 6e 5f 69 6e 74 65 72 72 75 70 74 69 62 6c 65  wn_interruptible
[    1.612788] data: 000000f0: 00 5f 5f 63 72 63 5f 68 69 64 5f 70 61 72 73     .__crc_hid_pars
[    1.649097] hv_storvsc: INQUIRY cmd 0x12 0x1 0x83 scsi status 0x0 srb status 0x1 length 52
[    1.649097] random: fast init done
[    1.649097] hv_storvsc:  payload size 288 count 1 offset 0 len 255 pfn 0x1f0576
[    1.649097] hv_storvsc:  sg 0: phys 0x1f0576000 virt ffff9a42f0576000 offset 0x0 length 255
[    1.649097] data: 00000000: 00 83 00 30 01 01 00 18 4d 53 46 54 20 20 20 20  ...0....MSFT    
[    1.649097] data: 00000010: 43 77 cc 85 5f 19 c2 46 ac 48 c7 33 b9 dd 2d 2a  Cw.._..F.H.3..-*
[    1.649097] data: 00000020: 01 03 00 10 60 02 24 80 43 77 cc 85 5f 19 c7 33  ....`.$.Cw.._..3
[    1.649097] data: 00000030: b9 dd 2d 2a 5f 55 4e 49 51 55 45 5f 49 44 5f 69  ..-*_UNIQUE_ID_i
[    1.649097] data: 00000040: 67 6e 6f 72 65 5f 73 70 65 63 69 61 6c 5f 64 72  gnore_special_dr
[    1.649097] data: 00000050: 69 76 65 72 73 74 79 70 65 31 34 00 5f 5f 70 61  iverstype14.__pa
[    1.649097] data: 00000060: 72 61 6d 5f 69 67 6e 6f 72 65 5f 73 70 65 63 69  ram_ignore_speci
[    1.649097] data: 00000070: 61 6c 5f 64 72 69 76 65 72 73 00 5f 5f 70 61 72  al_drivers.__par
[    1.649097] data: 00000080: 61 6d 5f 73 74 72 5f 69 67 6e 6f 72 65 5f 73 70  am_str_ignore_sp
[    1.649097] data: 00000090: 65 63 69 61 6c 5f 64 72 69 76 65 72 73 00 5f 5f  ecial_drivers.__
[    1.649097] data: 000000a0: 6b 73 79 6d 74 61 62 5f 68 69 64 5f 64 65 62 75  ksymtab_hid_debu
[    1.649097] data: 000000b0: 67 00 5f 5f 6b 73 74 72 74 61 62 5f 68 69 64 5f  g.__kstrtab_hid_
[    1.649097] data: 000000c0: 64 65 62 75 67 00 5f 5f 55 4e 49 51 55 45 5f 49  debug.__UNIQUE_I
[    1.649097] data: 000000d0: 44 5f 64 65 62 75 67 31 33 00 5f 5f 55 4e 49 51  D_debug13.__UNIQ
[    1.649097] data: 000000e0: 55 45 5f 49 44 5f 64 65 62 75 67 74 79 70 65 31  UE_ID_debugtype1
[    1.649097] data: 000000f0: 32 00 5f 5f 70 61 72 61 6d 5f 64 65 62 75 67     2.__param_debug
[    1.805271] input: Microsoft Vmbus HID-compliant Mouse as /devices/0006:045E:0621.0001/input/input1
[    1.805350] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x1 length 36
[    1.805351] hv_storvsc:  payload size 288 count 1 offset 2304 len 36 pfn 0x1f1988
[    1.805352] hv_storvsc:  sg 0: phys 0x1f1988000 virt ffff9a42f1988000 offset 0x900 length 36
[    1.805353] data: 00000000: 05 80 00 02 1f 00 00 00 4d 73 66 74 20 20 20 20  ........Msft    
[    1.805353] data: 00000010: 56 69 72 74 75 61 6c 20 44 56 44 2d 52 4f 4d 20  Virtual DVD-ROM 
[    1.805354] data: 00000020: 31 2e 30 20                                      1.0 
[    1.805379] scsi 1:0:0:0: CD-ROM            Msft     Virtual DVD-ROM  1.0  PQ: 0 ANSI: 0
[    1.812926] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.812927] hv_storvsc:  payload size 288 count 1 offset 2816 len 36 pfn 0x1f198b
[    1.812928] hv_storvsc:  sg 0: phys 0x1f198b000 virt ffff9a42f198b000 offset 0xb00 length 36
[    1.812953] data: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.812953] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.812954] data: 00000020: 00 00 00 00                                      ....
[    1.813258] scsi host1: scsi scan: INQUIRY result too short (5), using 36
[    1.813271] scsi 1:0:0:1: Direct-Access                                    PQ: 0 ANSI: 0
[    1.817903] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0 srb status 0x20 length 36
[    1.817921] hv_storvsc:  payload size 288 count 1 offset 2048 len 36 pfn 0x1f198a
[    1.817932] hv_storvsc:  sg 0: phys 0x1f198a000 virt ffff9a42f198a000 offset 0x800 length 36
[    1.817940] data: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.817941] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.817941] data: 00000020: 00 00 00 00                                      ....



The response from offline DVD device is shorter and contains stale data.
James Bottomley March 1, 2017, 11:09 p.m. UTC | #12
On Wed, 2017-03-01 at 13:27 -0800, Stephen Hemminger wrote:
> Ok here is much better data, wasn't accounting for the offset in the
> payload

But now both responses are the same:

> Working 4.10
[...]
> [    1.048920] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0
> srb status 0x20 length 36
> [    1.048920] hv_storvsc:  payload size 288 count 1 offset 1024 len
> 36 pfn 0x1f15d7
> [    1.048921] hv_storvsc:  sg 0: phys 0x1f15d7000 virt
> ffff9270b15d7000 offset 0x400 length 36
> [    1.048922] data: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00  ................
> [    1.048923] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00  ................
> [    1.048923] data: 00000020: 00 00 00 00                           
>            ....
> [    1.048942] scsi host1: scsi scan: INQUIRY result too short (5),
> using 36
> 
> 
> Broken 4.11
[...]
> [    1.812926] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0
> srb status 0x20 length 36
> [    1.812927] hv_storvsc:  payload size 288 count 1 offset 2816 len
> 36 pfn 0x1f198b
> [    1.812928] hv_storvsc:  sg 0: phys 0x1f198b000 virt
> ffff9a42f198b000 offset 0xb00 length 36
> [    1.812953] data: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00  ................
> [    1.812953] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00  ................
> [    1.812954] data: 00000020: 00 00 00 00                           
>            ....
> [    1.813258] scsi host1: scsi scan: INQUIRY result too short (5),
> using 36

Hyper-v is returning a buffer of zeros for INQUIRY to the offline
device in both cases ... that means the problem isn't where I thought
it was.

James
Stephen Hemminger March 1, 2017, 11:39 p.m. UTC | #13
On Wed, 01 Mar 2017 15:09:44 -0800
James Bottomley <James.Bottomley@HansenPartnership.com> wrote:

> On Wed, 2017-03-01 at 13:27 -0800, Stephen Hemminger wrote:
> > Ok here is much better data, wasn't accounting for the offset in the
> > payload  
> 
> But now both responses are the same:
> 
> > Working 4.10  
> [...]
> > [    1.048920] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0
> > srb status 0x20 length 36
> > [    1.048920] hv_storvsc:  payload size 288 count 1 offset 1024 len
> > 36 pfn 0x1f15d7
> > [    1.048921] hv_storvsc:  sg 0: phys 0x1f15d7000 virt
> > ffff9270b15d7000 offset 0x400 length 36
> > [    1.048922] data: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 00 00 00  ................
> > [    1.048923] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 00 00 00  ................
> > [    1.048923] data: 00000020: 00 00 00 00                           
> >            ....
> > [    1.048942] scsi host1: scsi scan: INQUIRY result too short (5),
> > using 36
> > 
> > 
> > Broken 4.11  
> [...]
> > [    1.812926] hv_storvsc: INQUIRY cmd 0x12 0x0 0x0 scsi status 0x0
> > srb status 0x20 length 36
> > [    1.812927] hv_storvsc:  payload size 288 count 1 offset 2816 len
> > 36 pfn 0x1f198b
> > [    1.812928] hv_storvsc:  sg 0: phys 0x1f198b000 virt
> > ffff9a42f198b000 offset 0xb00 length 36
> > [    1.812953] data: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 00 00 00  ................
> > [    1.812953] data: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 00 00 00  ................
> > [    1.812954] data: 00000020: 00 00 00 00                           
> >            ....
> > [    1.813258] scsi host1: scsi scan: INQUIRY result too short (5),
> > using 36  
> 
> Hyper-v is returning a buffer of zeros for INQUIRY to the offline
> device in both cases ... that means the problem isn't where I thought
> it was.
> 
> James

Yes. Earlier output wasn't accounting for offsets, new dump code is.
diff mbox

Patch

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 2af63a80c7fa..a51d8eba6e04 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1059,6 +1059,21 @@  static void storvsc_on_io_completion(struct storvsc_device *stor_device,
 		vstor_packet->vm_srb.srb_status,
 		vstor_packet->vm_srb.data_transfer_length);
 
+	if (stor_pkt->vm_srb.cdb[0] == INQUIRY)	{
+		struct scsi_cmnd *cmd = request->cmd;
+		struct scatterlist *sg = scsi_sglist(cmd);
+		struct page *page = sg_page(sg);
+		void *vaddr = kmap_atomic(page);
+		
+		print_hex_dump(KERN_INFO,
+			       "inquiry data: ", DUMP_PREFIX_OFFSET,
+			       16, 1,
+			       vaddr, vstor_packet->vm_srb.data_transfer_length,
+			       false);
+
+		kunmap_atomic(page);
+	}
+
 	/*
 	 * The current SCSI handling on the host side does
 	 * not correctly handle: