From: Douglas Gilbert <dgilbert@interlog.com>
To: "Jeremy Linton" <jlinton@tributary.com>,
"Hannes Reinecke" <hare@suse.de>,
"\"Kai Mäkisara (Kolumbus)\"" <kai.makisara@kolumbus.fi>
Cc: James Bottomley <jbottomley@parallels.com>,
Kay Sievers <kay@vrfy.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] st: Do not rewind for SG_IO
Date: Mon, 03 Feb 2014 16:16:07 -0500 [thread overview]
Message-ID: <52F00717.5060106@interlog.com> (raw)
In-Reply-To: <52EFB0E7.3000504@tributary.com>
On 14-02-03 10:08 AM, Jeremy Linton wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2/3/2014 9:06 AM, Hannes Reinecke wrote:
>
>> That's due to udev. Udev is getting events for each device it should create
>> a device node for. So for 'st' it'll get a series of events for 'stX', and
>> another series of events for 'nstX'. Udev will treat each of these events
>> separately, with distinct worker programs handling them. Each of those
>> workers run fully asynchronous and cannot access information from other
>> workers.
>
> So whats wrong with the simple solution? You throw the ones for st away, and
> create the st handles from the nst worker.
Doesn't seem to be any good solutions to this
problem. If you can't discovery something without
modifying its state, then what? For udev and/or
sg_inq to know about the special relationship
between st<i> nodes and nst<i> nodes seems
unreasonable IMO.
The cleanest way I can think of is for the st driver to
show this relationship via sysfs. But then why should
udev going mining for that relationship? A sysfs flag
from the st driver indicating a node is "undiscoverable"
might be a start.
A possible hack inside the st driver is to notice that
only the SG_IO ioctl is called on a file handle
between st_open(/dev/st*, O_RDONLY|O_NONBLOCK) and
st_release() then not auto-rewind it.
BTW Recent versions of sg_inq in Linux use
open(<dev>, O_RDONLY|O_NONBLOCK) unless 'sg_inq --block=1'
is given in which case open(<dev>, O_RDONLY) is used.
I just noticed that when scsi_debug makes a tape device,
the st driver silently ignores it, probably because
scsi_debug doesn't support a SSC command that st expects it
to respond to. IMO the st driver should make some noise if
it ever ignores a SCSI device with a PDT of 1 (i.e. a tape).
For example:
# lsscsi -g
[0:0:0:0] disk ATA INTEL SSDSC2CW12 400i /dev/sda /dev/sg0
[8:0:0:0] tape Linux scsi_debug 0004 - /dev/sg1
with the st module loaded and no indication in dmesg.
Doug Gilbert
next prev parent reply other threads:[~2014-02-03 21:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 8:46 [PATCH] st: Do not rewind for SG_IO Hannes Reinecke
2014-01-31 16:36 ` Jeremy Linton
2014-01-31 16:43 ` Jeremy Linton
2014-02-01 14:06 ` Hannes Reinecke
2014-02-01 15:23 ` "Kai Mäkisara (Kolumbus)"
2014-02-02 11:42 ` Hannes Reinecke
2014-02-02 19:15 ` "Kai Mäkisara (Kolumbus)"
2014-02-03 6:55 ` Hannes Reinecke
2014-02-03 14:50 ` Jeremy Linton
2014-02-03 15:06 ` Hannes Reinecke
2014-02-03 15:08 ` Jeremy Linton
2014-02-03 20:51 ` Kay Sievers
2014-02-03 21:11 ` James Bottomley
2014-02-03 21:58 ` Jeremy Linton
2014-02-03 22:15 ` Kay Sievers
2014-02-03 22:26 ` Jeremy Linton
2014-02-06 13:10 ` Hannes Reinecke
2014-02-06 13:21 ` Martin K. Petersen
2014-02-06 13:26 ` Hannes Reinecke
2014-02-06 13:50 ` Martin K. Petersen
2014-02-06 14:38 ` James Bottomley
2014-02-06 15:13 ` Hannes Reinecke
2014-02-06 19:21 ` Douglas Gilbert
2014-02-03 21:16 ` Douglas Gilbert [this message]
2014-02-03 21:24 ` Kay Sievers
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=52F00717.5060106@interlog.com \
--to=dgilbert@interlog.com \
--cc=hare@suse.de \
--cc=jbottomley@parallels.com \
--cc=jlinton@tributary.com \
--cc=kai.makisara@kolumbus.fi \
--cc=kay@vrfy.org \
--cc=linux-scsi@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).