linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: martin f krafft <madduck@debian.org>,
	linux-raid@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
	Michal Marek <mmarek@novell.com>
Subject: Re: RFC - device names and mdadm with some reference to udev.
Date: Tue, 28 Oct 2008 10:56:01 +1100	[thread overview]
Message-ID: <18694.21777.533214.972118@notabene.brown> (raw)
In-Reply-To: message from Kay Sievers on Monday October 27

On Monday October 27, kay.sievers@vrfy.org wrote:
> On Mon, Oct 27, 2008 at 23:37, Neil Brown <neilb@suse.de> wrote:
> > On Monday October 27, madduck@debian.org wrote:
> >> also sprach Neil Brown <neilb@suse.de> [2008.10.26.2356 +0100]:
> 
> >> I would really like to have a clear separation of competencies.
> >> Ideally, mdadm never creates any devices but leaves it all to udev,
> >> and all configuration about alternate names ("symlinks") is done in
> >> the udev rules file.
> >
> > Yes, I am moving towards this.  And it seems to be an idea with
> > resounding support judging by the follow-ups.  So I will probably go
> > even further than I was planning.
> >  - if mdadm detects that udev is active (how do I do that???)
> 
> Most tools just check if /dev/.udev/ exists.

So we are checking if udev is configured rather than if it is
running.  I guess that is what we really want to check.  OK - thanks.

> > However I do want to move towards using sysfs preferentially,
> > particularly for "mdadm --monitor".  I would rather that daemon didn't
> > ever open the device, as that can interfere with e.g. stopping the
> > array.  The "mdadm -D" calls from udev also need to not open the device.
> 
> Sounds fine, but remember that udev will always look at every device's
> content if not explicitly told no to do. It will look for filesystem
> signatures and other metadata at the beginning and the end of the
> device.

Ahh yes, of course.
So if I want to be able to stop an array immediately after starting
(or changing) it (as I often do in test scripts, but may not need to
in real life) I need to wait for udev to settle.
So if I just need this in a script I can add
    udevadm settle
somewhere between the 'start' and the 'stop'.

I wonder if I ever want mdadm to call that directly?  I suspect that
if it got called from a udev rule it would deadlock, so I'd need to be
careful of that.

> 
> > One issue that looms in my mind as I consider this is the Usage of
> > mdadm when e.g. creating an array
> >
> >   mdadm -C /dev/md5 -l5 -n3 /dev/sd[bcd]
> >
> > I need to give the name of an array device (/dev/md5) that may not
> > exist but that mdadm doesn't now want to create.
> >
> > Once I have created the array I might want to look at the details with
> >
> >   mdadm --detail /dev/md5
> >
> > The important role that the string "/dev/md5" is serving here is
> > providing a connection between the two command.  Whatever I created in
> > the first is what I access in the second.
> 
> Can't you just use the major/minor is there is no other meaningful
> name? The devnum can not change on any system, and is always valid as
> long as the kernel device exists.

Maybe.  Though in general I would rather that the user didn't allocate
the minor number.
I could get "mdadm --create" to report
   mdadm: created array as /dev/md42
or
   mdadm: created md array 42

and then you could simply
   mdadm --detail 42

however that would be awkward for scripts.

I don't need to require that a name be given, but I want to allow it.
An I need to stay at least a little bit compatible with current mdadm
usage and practices.

I'm definitely considering allowing

  mdadm --create md0 ....

(i.e. drop the '/dev/').  That isn't a big step in functionality, but
it might be an important step in perceptions.

Thanks, the picture is slowly becoming clearer.
NeilBrown

  reply	other threads:[~2008-10-27 23:56 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-26 22:56 RFC - device names and mdadm with some reference to udev Neil Brown
2008-10-27  8:22 ` martin f krafft
2008-10-27 15:13   ` Doug Ledford
2008-10-27 16:10     ` Andre Noll
2008-10-27 16:37       ` Kay Sievers
2008-10-27 16:59         ` martin f krafft
2008-10-27 18:31           ` Kay Sievers
2008-10-28  6:21             ` Luca Berra
2008-10-27 17:24         ` Doug Ledford
2008-10-27 23:36           ` Neil Brown
2008-10-29 18:49             ` Doug Ledford
2008-10-28  6:32           ` Luca Berra
2008-10-28  9:42           ` occasional bitmap was " David Greaves
2008-10-27 17:30         ` Andre Noll
2008-10-27 16:13     ` Kay Sievers
2008-10-27 22:37   ` Neil Brown
2008-10-27 22:51     ` Kay Sievers
2008-10-27 23:56       ` Neil Brown [this message]
2008-10-28  0:20         ` Kay Sievers
2008-10-28  6:17   ` Luca Berra
2008-10-27 12:41 ` Kay Sievers
2008-10-27 13:23   ` David Lethe
2008-10-27 23:27     ` Neil Brown
2008-10-27 23:48       ` David Lethe
2008-10-27 13:24   ` Andre Noll
2008-10-27 14:20     ` Kay Sievers
2008-10-27 23:23   ` Neil Brown
2008-10-28  0:03     ` Kay Sievers
2008-10-28  0:43       ` Neil Brown
2008-10-28  1:16         ` Kay Sievers
2008-10-28  1:44       ` Neil Brown
2008-10-28  1:52         ` Kay Sievers
2008-10-28  1:54           ` Kay Sievers
2008-10-31 20:54       ` Debian and udev (was: RFC - device names and mdadm with some reference to udev.) martin f krafft
2008-10-31 23:08         ` Bernd Schubert
2008-10-29  8:56     ` RFC - device names and mdadm with some reference to udev Gabor Gombas
2008-10-31 20:49     ` mdp devices on Debian (was: RFC - device names and mdadm with some reference to udev.) martin f krafft
2008-10-30 17:18 ` RFC - device names and mdadm with some reference to udev Doug Ledford
2008-10-31  9:45   ` Neil Brown
2008-11-03  9:29     ` Gabor Gombas
2008-11-03 10:33       ` Kay Sievers
2008-11-03 11:58         ` Gabor Gombas
2008-11-03 12:11           ` Kay Sievers
2008-11-03 14:34     ` Doug Ledford
2008-11-03 15:20       ` Dan Williams
2008-11-07  6:13       ` Neil Brown
2008-11-02 13:47   ` Luca Berra
     [not found] <dledford@redhat.com>
2008-10-31  1:02 ` greg
2008-10-31  9:18   ` Neil Brown
2008-11-02 13:52     ` Luca Berra
  -- strict thread matches above, loose matches on Subject: below --
2008-11-04 15:36 greg

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=18694.21777.533214.972118@notabene.brown \
    --to=neilb@suse.de \
    --cc=dledford@redhat.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=madduck@debian.org \
    --cc=mmarek@novell.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;
as well as URLs for NNTP newsgroup(s).