public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Elliott, Robert (Server Storage)" <Elliott@hp.com>
Cc: "James Bottomley (jbottomley@parallels.com)"
	<jbottomley@parallels.com>, Christoph Hellwig <hch@infradead.org>,
	"dgilbert@interlog.com" <dgilbert@interlog.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"Don Brace (PMC)" <Don.Brace@pmcs.com>,
	"Scales, Webb" <webb.scales@hp.com>
Subject: Re: Concurrent SG_SCSI_RESET ioctls
Date: Sat, 11 Oct 2014 04:05:05 -0700	[thread overview]
Message-ID: <20141011110505.GA2928@infradead.org> (raw)
In-Reply-To: <94D0CD8314A33A4D9D801C0FE68B402958CE9B54@G4W3202.americas.hpqcorp.net>

On Fri, Oct 10, 2014 at 11:32:26PM +0000, Elliott, Robert (Server Storage) wrote:
> Problem
> =======
> If you run sg_reset --device concurrently to multiple
> devices on the same host, then some of them will run
> into tmf_in_progress and have scsi_nonblockable_ioctl
> return -ENODEV.  This causes sd_ioctl to send the ioctl
> request to the LLD's ioctl function, where it gets
> rejected as unsupported with -ENOTTY.  sg_reset ends
> up displaying:
> 	sg_reset: SG_SCSI_RESET failed: Inappropriate ioctl for device
> 
> Any suggestions for how to fix this?  

The who cascading through the different ioctl handlers is a mess.  I
think we'll need to rework it entirely, and i'll try to come up with
something for it ASAP.

> Is the check of scsi_host_in_recovery, which includes
> tmf_in_progress, too strong?  Most LLDs are not parallel
> SCSI where you can just have one TMF on the bus at a
> time anymore.

I suspect we could relax this, but that's a different issue
from the incorrect error handling in the ioctl handler cascade.

> Is returning -ENODEV if the host is in recovery the
> wrong code?  There might be a device there...it's
> just that access is temporarily blocked.

It's an odd error return, but it's long established.  I don't think
we can still change it.

> Also, should scsi_nonblockable_ioctl return -ENOTTY rather
> than -ENODEV if cmd is unsupported?  There's not really
> a no-device problem.

It should - or even better we should kill off scsi_nonblockable_ioctl
entirely.  Stay tuned.


  reply	other threads:[~2014-10-11 11:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10 23:32 Concurrent SG_SCSI_RESET ioctls Elliott, Robert (Server Storage)
2014-10-11 11:05 ` Christoph Hellwig [this message]
2014-10-11 16:11 ` Christoph Hellwig
2014-10-11 22:06   ` Elliott, Robert (Server Storage)
2014-10-14 11:13     ` Christoph Hellwig
2014-10-14 16:42       ` Douglas Gilbert
2014-10-15 13:25         ` Christoph Hellwig
2014-10-15 14:34           ` Elliott, Robert (Server Storage)
2014-10-24 14:51         ` Christoph Hellwig
2014-10-24 16:29           ` Douglas Gilbert
2014-10-11 23:04   ` Elliott, Robert (Server Storage)
2014-10-13  9:15   ` Bart Van Assche
2014-10-13 10:23     ` Christoph Hellwig

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=20141011110505.GA2928@infradead.org \
    --to=hch@infradead.org \
    --cc=Don.Brace@pmcs.com \
    --cc=Elliott@hp.com \
    --cc=dgilbert@interlog.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=webb.scales@hp.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