All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Xiao Ni <xni@redhat.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: The dev node can't be released at once after stopping raid
Date: Thu, 31 Aug 2017 16:48:02 +1000	[thread overview]
Message-ID: <8760d4fd25.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <1889255088.3872827.1504160273377.JavaMail.zimbra@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]

On Thu, Aug 31 2017, Xiao Ni wrote:
>
> There is a bug https://bugzilla.redhat.com/show_bug.cgi?id=1444434. 
> Another tool(blivet) stops raid device and the device node still exists.
> Then it calls mdadm -S xxx again and it fails.

I would suggest that the tool is broken.  It should trust mdadm and not
double check that it actually worked.

>                                                 So I ask myself why
> /dev/mdxxx can't be removed immediately after command mdadm -S. 

Because udev is asynchronous.  You cannot rely on things happening
instantly.  udev doesn't work that way.

mdadm has a function 'wait_for()' which waits for the device name to
appear when the array is started.  Possibly we could add something to
wait for udev to remove the device when the array is stopped, but I
really think it shouldn't be necessary.  Nothing should look at the name
after the device is stopped.

>
> In topic "MD Remnants After –stop", you said the REMOVE events are 
> generated by "md_free() -> del_gendisk() ->  blk_unregister_queue()".
> When mdadm -S return, the REMOVE events should be generated already,
> right?

Not necessarily. md_free is called from mddev_delayed_delete, which is
run on a work-queue, so might be delayed briefly.

>
> I always have a question. Who is responsible for removing the device
> node under /dev/ directory? The function unlink()?

udev is responsible for removing the device.  Obviously udev uses unlink()
to do this.

NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2017-08-31  6:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <51439640.15505639.1496113073965.JavaMail.zimbra@redhat.com>
2017-06-01  3:47 ` The dev node can't be released at once after stopping raid Xiao Ni
2017-06-01  4:43   ` Zhilong Liu
2017-06-01  5:50     ` Xiao Ni
2017-08-31  3:55       ` Xiao Ni
2017-08-31  4:36         ` NeilBrown
2017-08-31  6:17           ` Xiao Ni
2017-08-31  6:48             ` NeilBrown [this message]
2017-08-31  7:16               ` Xiao Ni
2017-08-31 23:39                 ` NeilBrown
2017-09-01  0:30                   ` Xiao Ni
2017-09-01  4:34                     ` 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=8760d4fd25.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=xni@redhat.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 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.