All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Lyakas <alex.bolshoy@gmail.com>
To: NeilBrown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: MD devnode still present after 'remove' udev event, and mdadm reports 'does not appear to be active'
Date: Fri, 2 Sep 2011 00:18:12 +0300	[thread overview]
Message-ID: <CAGRgLy5nBqx_86vi5AxDdYGBkoP5GJsUHFT1STfKmTzgz45mew@mail.gmail.com> (raw)
In-Reply-To: <20110831105455.04fd585e@notabene.brown>

Thank you for looking at both issues, Neil.

Alex.


On Wed, Aug 31, 2011 at 3:54 AM, NeilBrown <neilb@suse.de> wrote:
> On Tue, 30 Aug 2011 18:18:11 +0300 Alexander Lyakas <alex.bolshoy@gmail.com>
> wrote:
>
>> Thanks, Neil.
>>
>> Although according to udev documentation: "the udev events are sent
>> out after udev has finished its event processing, all rules have been
>> processed, and needed device nodes are created."
>>
>> Also looking at udev-worker code of udevd, the
>> udev_monitor_send_device() call is done after all the rules have been
>> processed.
>>
>> Nevertheless, I looked at udevadm_settle.c and did some equivalent of
>> that in my code, and it looks like the issue is resolved. Perhaps
>> there is something md-specific here?
>
> I cannot see how it would be md-specific.  mdadm doesn't create or remove
> devices when udev is active - it leaves all that to udev.
> If you are curious I suggest you ask the udev developers.
>
>>
>> Another thing, since you are reading this thread, I wanted to ask
>> whether you have any advice on the "RAID5: failing an active component
>> during spare rebuild - arrays hangs" thread I opened some time ago.
>> Since you were not answering, I assume there is nothing additional you
>> can advise about, correct? I apologize if this off-topic was
>> inappropriate.
>
> It could mean that I had nothing extra to say, but it could also mean that I
> got distracted, forgot, and never got back to it.  I live in a world of
> distractions :-(
>
> But a reminder never hurts - it shows that it is important to you, so that
> makes it at least a little bit important to me.  I'll go back and have a look
> and see if I have anything useful to add.
>
> NeilBrown
>
>
>>
>> Thanks for the help,
>>   Alex.
>>
>>
>>
>> On Tue, Aug 30, 2011 at 12:25 AM, NeilBrown <neilb@suse.de> wrote:
>> > On Mon, 29 Aug 2011 20:17:34 +0300 Alexander Lyakas <alex.bolshoy@gmail.com>
>> > wrote:
>> >
>> >> Greetings everybody,
>> >>
>> >> I issue
>> >> mdadm --stop /dev/md0
>> >> and I want to reliably determine that the MD devnode (/dev/md0) is gone.
>> >> So I look for the udev 'remove' event for that devnode.
>> >> However, in some cases even after I see the udev event, I issue
>> >> mdadm --detail /dev/md0
>> >> and I get:
>> >> mdadm: md device /dev/md0 does not appear to be active
>> >>
>> >> According to Detail.c, this means that mdadm can successfully do
>> >> open("/dev/md0") and receive a valid fd.
>> >> But later, when issuing ioctl(fd, GET_ARRAY_INFO) it receives ENODEV
>> >> from the kernel.
>> >>
>> >> Can somebody suggest an explanation for this behavior? Is there a
>> >> reliable way to know when a MD devnode is gone?
>> >
>> > run "udevadm settle" after stopping /dev/md0  is most likely to work.
>> >
>> > I suspect that udev removes the node *after* you see the 'remove' event.
>> > Sometimes so soon after that you don't see the lag - sometimes a bit later.
>> >
>> > NeilBrown
>> >
>> >>
>> >> Thanks,
>> >>   Alex.
>> >> --
>> >> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
>> >> the body of a message to majordomo@vger.kernel.org
>> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> >
>> >
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" 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-09-01 21:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 17:17 MD devnode still present after 'remove' udev event, and mdadm reports 'does not appear to be active' Alexander Lyakas
2011-08-29 21:25 ` NeilBrown
2011-08-30 15:18   ` Alexander Lyakas
2011-08-31  0:54     ` NeilBrown
2011-09-01 21:18       ` Alexander Lyakas [this message]
2011-09-13  8:49   ` Alexander Lyakas
2011-09-21  5:03     ` NeilBrown
2011-09-23 19:24       ` Alexander Lyakas
2011-09-25 10:15         ` NeilBrown
2011-10-11 13:11           ` Alexander Lyakas
2011-10-12  3:45             ` NeilBrown
2011-10-19 12:01               ` Alexander Lyakas
2011-10-19 23:56                 ` NeilBrown
2011-10-23  9:03                   ` Alexander Lyakas
2011-10-23 22:55                     ` NeilBrown

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=CAGRgLy5nBqx_86vi5AxDdYGBkoP5GJsUHFT1STfKmTzgz45mew@mail.gmail.com \
    --to=alex.bolshoy@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.