From: NeilBrown 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 Signed-off-by: Andrew Morton --- drivers/md/md.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/md/md.c~md-allow-mddevs-to-live-a-bit-longer-to-avoid-a-loop-with-udev drivers/md/md.c --- a/drivers/md/md.c~md-allow-mddevs-to-live-a-bit-longer-to-avoid-a-loop-with-udev +++ a/drivers/md/md.c @@ -292,7 +292,7 @@ static mddev_t * mddev_find(dev_t unit) atomic_set(&new->active, 1); spin_lock_init(&new->write_lock); init_waitqueue_head(&new->sb_wait); - new->dead = 1; + new->dead = 0; new->queue = blk_alloc_queue(GFP_KERNEL); if (!new->queue) { _