linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Luca Berra <bluca@comedia.it>
Cc: Linux RAID Mailing List <linux-raid@vger.kernel.org>
Subject: Re: [Patch mdadm] Add hot-unplug support to mdadm
Date: Wed, 7 Apr 2010 16:59:42 +1000	[thread overview]
Message-ID: <20100407165942.1ab0f7e7@notabene.brown> (raw)
In-Reply-To: <20100407053255.GB16693@maude.comedia.it>

On Wed, 7 Apr 2010 07:32:55 +0200
Luca Berra <bluca@comedia.it> wrote:

> On Tue, Apr 06, 2010 at 10:02:58PM -0400, Doug Ledford wrote:
> >On 04/06/2010 09:30 PM, Neil Brown wrote:
> >> - I cannot say I like the process of hunting through /proc/mdstat for
> >>   a device name that textually matches the name that udev has just
> >>   removed from /dev.  It feels too indirect.
> >>   I was really hoping to just use /sys/$DEVPATH/holders to find the
> >>   containing arrays, but $DEVPATH has been destroyed before udev
> >>   gets to run anything .. even though the final object is still in
> >>   use.  That is really sad!
> >
> >I agree.  The fact that everything disappears before we can use it to
> >remove it from the array was a bit problematic.  And I too thought that
> >this was too indirect and error prone.  But, the fact remains that A) if
> 
> Is there any chance of having udev issuing a pre-remove event, before
> destroying /dev and sysfs, it would be far more useful than what we have
> now.

No.  udev has not ability to delay the kernel from removing things.
The kernel removes stuff, then sends a message to udev - udev responds by
cleaning up the user-space side.

If you want to know anything about a device on removal, you need to record
that information somewhere.  udev does this to some extent, so when a device
is removed, it knows the major/minor number (at least I assume that is how it
works). See /dev/.udev/db/

So we could generate uevents whenever a devices is added to or removed from
an array, then get udev to somehow record the current state so that when a
device is removed from the system, we know which array it is part of.
But that seems like a bit of a sledgehammer approach - my first impression is
that it would be worse than scanning /proc/mdstat.

Thanks,
NeilBrown

  reply	other threads:[~2010-04-07  6:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-05 16:40 [Patch mdadm] Add hot-unplug support to mdadm Doug Ledford
2010-04-06 16:26 ` Doug Ledford
2010-04-07  1:30 ` Neil Brown
2010-04-07  2:02   ` Doug Ledford
2010-04-07  2:24     ` Doug Ledford
2010-04-07  3:07       ` Doug Ledford
2010-04-07  5:32     ` Luca Berra
2010-04-07  6:59       ` Neil Brown [this message]
2010-04-08 23:31     ` Neil Brown
2010-04-09  0:33       ` Neil Brown
2010-04-09 20:02         ` Doug Ledford
2010-04-13  9:28         ` Tomáš Dulík
2010-04-13 16:27           ` Doug Ledford
2010-04-13 18:49           ` Doug Ledford
     [not found]             ` <4BC5ADB2.2060705@unart.cz>
2010-04-15  5:24               ` Neil Brown
2010-04-15 13:11                 ` Tomáš Dulík
2010-04-13 19:04         ` Doug Ledford

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=20100407165942.1ab0f7e7@notabene.brown \
    --to=neilb@suse.de \
    --cc=bluca@comedia.it \
    --cc=linux-raid@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).