public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <jejb@linux.vnet.ibm.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>,
	Josh Poulson <jopoulso@microsoft.com>,
	v-adsuho@microsoft.com, linux-scsi@vger.kernel.org,
	Haiyang Zhang <haiyangz@microsoft.com>
Subject: Re: SCSI regression in 4.11
Date: Tue, 28 Feb 2017 15:48:52 -0800	[thread overview]
Message-ID: <1488325732.11610.9.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170228105741.6253bb8a@xeon-e3>

On Tue, 2017-02-28 at 10:57 -0800, Stephen Hemminger wrote:
> On Tue, 28 Feb 2017 09:06:13 -0800
> James Bottomley <jejb@linux.vnet.ibm.com> wrote:
> 
> > On Tue, 2017-02-28 at 08:32 -0700, Jens Axboe wrote:
> > > On 02/28/2017 07:08 AM, Christoph Hellwig wrote:  
> > > > On Mon, Feb 27, 2017 at 05:19:31PM -0800, Stephen Hemminger
> > > > wrote:  
> > > > > Fixes: ee5242360424 ("scsi: zero per-cmd driver data before
> > > > > each
> > > > > I/O")
> > > > > 
> > > > > but that is already in linux-next.
> > > > > 
> > > > > Noticed another place where memset(of the data was being done
> > > > > not
> > > > > the extra bits.
> > > > > Tried this, but didn't fix it either...  
> > > > 
> > > > Are you using blk-mq or the legacy request code?  
> > > 
> > > Stephen doesn't have MQ set in the config he posted, I'm assuming
> > > he 
> > > didn't boot with scsi_mod.use_blk_mq=true. In a previous email, I
> > > asked if turning on MQ makes a difference.  
> > 
> > OK, since we're not making much progress, Stephen, could you insert
> > some debugging into the storvsc driver?  The trace clearly shows
> > we're
> > getting zeros back in the buffer when we should have data from the
> > initial scan.  Firstly, does the vmbus think it's transferring any
> > data
> > for the INQUIRY and READ_CAPACITY commands (looks like
> > storvsc_command_completion() data_transfer_length)?  If it does,
> > there's probably an issue initialising the sg list.  If it doesn't,
> > we're probably sending bogus commands.
> > 
> > James
> > 
> 
> The following code in storvsc looks suspicious
> 
> static void storvsc_on_io_completion(struct storvsc_device
> *stor_device,
> 				  struct vstor_packet *vstor_packet,
> 				  struct storvsc_cmd_request *request)
> {
> 	struct vstor_packet *stor_pkt;
> 	struct hv_device *device = stor_device->device;
> 
> 	stor_pkt = &request->vstor_packet;
> 
> 	/*
> 	 * The current SCSI handling on the host side does
> 	 * not correctly handle:
> 	 * INQUIRY command with page code parameter set to 0x80
> 	 * MODE_SENSE command with cmd[2] == 0x1c
> 	 *
> 	 * Setup srb and scsi status so this won't be fatal.
> 	 * We do this so we can distinguish truly fatal failues
> 	 * (srb status == 0x4) and off-line the device in that case.
> 	 */
> 
> 	if ((stor_pkt->vm_srb.cdb[0] == INQUIRY) ||
> 	   (stor_pkt->vm_srb.cdb[0] == MODE_SENSE)) {
> 		vstor_packet->vm_srb.scsi_status = 0;
> 		vstor_packet->vm_srb.srb_status = SRB_STATUS_SUCCESS;
> 	}
> 
> If SCSI layer is sending inquiry about devices to do scanning then 
> wouldn't this workaround break things?  Maybe a better to fully test 
> for the broken command.

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.

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.

James

  reply	other threads:[~2017-03-01  1:57 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 23:30 SCSI regression in 4.11 Stephen Hemminger
2017-02-28  1:19 ` Stephen Hemminger
2017-02-28  2:16   ` Jens Axboe
2017-02-28 14:08   ` Christoph Hellwig
2017-02-28 15:32     ` Jens Axboe
2017-02-28 17:06       ` James Bottomley
2017-02-28 17:16         ` Stephen Hemminger
2017-02-28 17:31           ` Jens Axboe
2017-02-28 18:41         ` Stephen Hemminger
2017-02-28 19:10           ` James Bottomley
2017-02-28 18:57         ` Stephen Hemminger
2017-02-28 23:48           ` James Bottomley [this message]
2017-03-01  1:25             ` Stephen Hemminger
2017-03-01  6:20               ` James Bottomley
2017-03-01  6:48                 ` Stephen Hemminger
2017-03-01 15:50                   ` Christoph Hellwig
2017-03-01 15:54                     ` Stephen Hemminger
2017-03-02  0:01                       ` Christoph Hellwig
2017-03-02  0:56                         ` Christoph Hellwig
2017-03-02  1:40                           ` Stephen Hemminger
2017-03-02 13:25                             ` Hannes Reinecke
2017-03-02 17:48                               ` Stephen Hemminger
2017-03-02 18:23                               ` Stephen Hemminger
2017-03-02 18:36                                 ` James Bottomley
2017-03-02 19:05                                   ` Stephen Hemminger
2017-03-02 19:18                                     ` James Bottomley
2017-03-03 22:29                                       ` Stephen Hemminger
2017-03-04  0:50                                       ` [RFC] hv_storvsc: error handling Stephen Hemminger
2017-03-04 11:55                                         ` Hannes Reinecke
2017-03-04 21:03                                         ` KY Srinivasan
2017-03-04 21:36                                           ` James Bottomley
2017-03-04 21:39                                             ` KY Srinivasan
2017-03-04 23:55                                               ` KY Srinivasan
2017-03-06 16:36                                           ` Stephen Hemminger
2017-03-06 17:48                                             ` KY Srinivasan
2017-03-06 17:57                                               ` Stephen Hemminger
2017-03-07  5:06                                               ` Christoph Hellwig
2017-03-07  6:08                                                 ` KY Srinivasan
2017-03-02  0:57                         ` SCSI regression in 4.11 Stephen Hemminger
2017-03-01 16:13                     ` Stephen Hemminger
2017-03-01 18:48                 ` Stephen Hemminger
2017-03-01 18:57                   ` James Bottomley
2017-03-01 19:20                     ` James Bottomley
2017-03-01 19:39                       ` Stephen Hemminger
2017-03-01 21:27                       ` Stephen Hemminger
2017-03-01 23:09                         ` James Bottomley
2017-03-01 23:39                           ` Stephen Hemminger
2017-03-01 19:00                   ` Linus Torvalds
2017-02-28 17:33     ` Stephen Hemminger

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=1488325732.11610.9.camel@linux.vnet.ibm.com \
    --to=jejb@linux.vnet.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=hch@lst.de \
    --cc=jopoulso@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=martin.petersen@oracle.com \
    --cc=stephen@networkplumber.org \
    --cc=torvalds@linux-foundation.org \
    --cc=v-adsuho@microsoft.com \
    /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