public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: David Zeuthen <davidz@redhat.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, kay.sievers@vrfy.org
Subject: Re: [PATCH] scsi: ensure bsg device is available before announcing scsi device
Date: Fri, 04 Mar 2011 11:50:16 -0500	[thread overview]
Message-ID: <1299257417.4710.29.camel@satan> (raw)
In-Reply-To: <1299253276.2461.33.camel@mulgrave.site>

On Fri, 2011-03-04 at 09:41 -0600, James Bottomley wrote:
> > Note that we can already do all this today but since the sysfs layout
> > looks like this
> > 
> >  0:0:0:0
> >  |-- block
> >  │   +-- sdb
> >  |   |   ...
> >  |
> >  |-- bsg
> >  |   +-- 0:0:0:0
> >  |   |   ...
> > 
> > This setup is rather unfortunate because the bsg device and block device
> > are siblings and, thus, cannot share information with each other. This
> > is because only children can import information from their parents -
> > anything else is prone to races.
> > 
> > Now, since we currently run scsi_id + friends on the block device it
> > would mean running these tools _again_ on the bsg device. Which,
> > honestly is a waste. So the idea was simply to always run it on the scsi
> > device (using the bsg node) and simply just import the data to the block
> > device and bsg devices (both are children of the scsi device).
> 
> OK, so why not simply an event on BSG device creation then?  To make
> what you want to do work, it sounds like we should be moving BSG binding
> farther back in the configure sequence (to the same place where we'd be
> binding an ordinary ULD).  It also perhaps sounds like we don't need any
> events on the sdev.  The only reason we might find them useful is if we
> were going to do configuration from user space (which was a proposal
> once upon a time).  The sdev was never designed to be any sort of thing
> the user saw (well, except as an identifying label).  That's why you
> need to bind a driver (including bsg) to speak to it.

Not entirely sure what you exactly are proposing here but note that the
root problem is that the block device and bsg device are siblings... the
only way this can work without races in user space is to have their
common ancestor do the work (e.g. run /lib/udev/scsi_id + friends) on
the 'add' uevent, not on some 'change' uevent later... there is just no
way it will work otherwise.

If we didn't care about backward compat, maybe it could look like this

 0:0:0:0
 +-- dev    <-- this is dev file for the bsg device
 |
 +-- block
 |   +-- sdb
 |   |   +-- dev  <-- this is the dev file for the block device

so we get the bsg device as the first uevent and the block device with
the other one. With this setup we'd run /lib/udev/scsi_id + friends on
the bsg device node and then we'd import it for the block device node
and everything would be good.

That said, I don't think we can make such a change as it would probably
break some parts of user space...

    David


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-03-04 16:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 19:02 [PATCH] scsi: ensure bsg device is available before announcing scsi device David Zeuthen
2011-03-03 17:56 ` James Bottomley
2011-03-04 14:32   ` David Zeuthen
2011-03-04 15:41     ` James Bottomley
2011-03-04 16:50       ` David Zeuthen [this message]
2011-03-04 17:10         ` James Bottomley

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=1299257417.4710.29.camel@satan \
    --to=davidz@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=kay.sievers@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