From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: NeilBrown <neilb@suse.com>
Cc: linux-raid@vger.kernel.org, Marc Smith <marc.smith@mcc.edu>
Subject: Re: [mdadm PATCH] mdopen: open md devices O_RDONLY
Date: Mon, 05 Dec 2016 09:26:42 -0500 [thread overview]
Message-ID: <wrfjfum2bgf1.fsf@redhat.com> (raw)
In-Reply-To: <87eg1m6gco.fsf@notabene.neil.brown.name> (NeilBrown's message of "Mon, 05 Dec 2016 17:27:03 +1100")
NeilBrown <neilb@suse.com> writes:
> There is no need to request write access when opening
> the md device, as we never write to it, and none of the
> ioctls we use require write access.
>
> If we do open with write access, then when we close, udev notices that
> the device was closed after being open for write access, and it
> generates a CHANGE event.
>
> This is generally unwanted, and particularly problematic when mdadm is
> trying to --stop the array, as the CHANGE event can cause the array to
> be re-opened before it completely closed, which results in a new mddev
> being allocated.
>
> So just use O_RDONLY instead of O_RDWR.
>
> Reported-by: Marc Smith <marc.smith@mcc.edu>
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
> mdassemble.c | 2 +-
> mdopen.c | 4 +---
> 2 files changed, 2 insertions(+), 4 deletions(-)
Applied!
Thanks,
Jes
prev parent reply other threads:[~2016-12-05 14:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 6:27 [mdadm PATCH] mdopen: open md devices O_RDONLY NeilBrown
2016-12-05 14:26 ` Jes Sorensen [this message]
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=wrfjfum2bgf1.fsf@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=linux-raid@vger.kernel.org \
--cc=marc.smith@mcc.edu \
--cc=neilb@suse.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