From: NeilBrown <neilb@suse.de>
To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>, Al Viro <viro@zeniv.linux.org.uk>,
Doug Ledford <dledford@redhat.com>
Subject: [PATCH 0/2] RFC: allow md devices to disappear when not in use.
Date: Mon, 24 Nov 2008 14:55:30 +1100 [thread overview]
Message-ID: <20081124035516.3465.66413.stgit@notabene.brown> (raw)
The following two patches - which are in -next if you need to see
their context - make two fairly significant changes to the way md
devices are (or can be) created and destroyed.
They include a smallish change to fs/block_dev.c so I'm cc:ing recent
modifiers of that file.
Currently, md devices spring into existence when a corresponding
device-special file is opened, and they remain around forever, or
until the module is unloaded.
The first of these patches causes md devices to disappear when they
are no longer in use. More precisely: after the last close when the
array is completely unconfigured.
This opens up a small race if one process is opening the device about
the same time that another process is closing it for the last time.
Closing this race requires the small change in fs/block_dev.c
The second patch allows md device to be created with a name rather
than a number. Sometimes it is more convenient to think about arrays
by name, and supporting this in the kernel is a useful idea (From Doug
Ledford).
If you write e.g. "md_foo" to "/sys/modules/md_mod/parameters/new_array"
then an md device was an arbitrary minor number will be created named
md_foo rather than e.g. md256. (the "md_" prefix is required).
Current tools seem to cope perfectly with md devices disappearing when
finished with. They are not likely to cope with "md_foo" device
naming, but that would only be used if a new tool requested it, so it
is up to that tool (mdadm) to not cause confusion.
Any review comments most welcome.
Thanks,
NeilBrown
---
NeilBrown (2):
Allow md devices to be created by name.
md: make devices disappear when they are no longer needed.
drivers/md/md.c | 175 ++++++++++++++++++++++++++++++++++++++-------
fs/block_dev.c | 14 ++++
include/linux/raid/md_k.h | 5 +
3 files changed, 165 insertions(+), 29 deletions(-)
--
next reply other threads:[~2008-11-24 3:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-24 3:55 NeilBrown [this message]
2008-11-24 3:55 ` [PATCH 1/2] md: make devices disappear when they are no longer needed NeilBrown
2008-11-24 4:18 ` Tejun Heo
2008-11-24 5:13 ` Neil Brown
2008-11-24 5:34 ` Tejun Heo
2008-11-24 6:10 ` NeilBrown
2008-11-24 6:12 ` Tejun Heo
2008-11-24 6:24 ` Al Viro
2008-11-24 6:56 ` Tejun Heo
2008-11-24 13:31 ` Al Viro
2008-11-24 14:04 ` Tejun Heo
2008-11-24 14:26 ` Tejun Heo
2008-11-24 14:48 ` Al Viro
2008-11-24 16:08 ` Tejun Heo
2008-11-24 16:42 ` Al Viro
2008-11-24 17:18 ` Tejun Heo
2008-11-28 0:23 ` Neil Brown
2008-11-24 4:24 ` Al Viro
2008-11-24 4:47 ` Neil Brown
2008-11-24 6:38 ` Al Viro
2008-11-24 3:55 ` [PATCH 2/2] Allow md devices to be created by name 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=20081124035516.3465.66413.stgit@notabene.brown \
--to=neilb@suse.de \
--cc=dledford@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=tj@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®