[lkml]   [2006]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 005 of 5] md: Allow mddevs to live a bit longer to avoid a loop with udev.

As md devices a automatically created on first open, and automatically
destroyed on last close if they have no significant state, a loop can
be caused with udev.

If you open/close an md device that will generate add and remove
events to udev. udev will open the device, notice nothing is there
and close it again ... which generates another pair of add/remove events.
Ad infinitum.

So: Change md to only destroy a device if an explicity MD_STOP was
requested. This means that md devices might hang around longer than
you would like, but it is easy to get rid of them, and that could even
be automated in user-space (e.g. by mdadm --monitor).

Signed-off-by: Neil Brown <>

### Diffstat output
./drivers/md/md.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff .prev/drivers/md/md.c ./drivers/md/md.c
--- .prev/drivers/md/md.c 2006-12-07 21:01:11.000000000 +1100
+++ ./drivers/md/md.c 2006-12-08 10:22:46.000000000 +1100
@@ -292,7 +292,7 @@ static mddev_t * mddev_find(dev_t unit)
atomic_set(&new->active, 1);
- new->dead = 1;
+ new->dead = 0;

new->queue = blk_alloc_queue(GFP_KERNEL);
if (!new->queue) {
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2006-12-08 02:09    [W:0.047 / U:5.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site