linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md: Drop sending a change uevent when stopping
@ 2016-02-17 16:25 Sebastian Parschauer
  2016-02-17 18:19 ` Shaohua Li
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Parschauer @ 2016-02-17 16:25 UTC (permalink / raw)
  To: linux-raid
  Cc: Sebastian Parschauer, Shaohua Li, Jes Sorensen, Brassow Jonathan,
	Artur Paszkiewicz, NeilBrown, Hannes Reinecke, systemd-devel

When stopping an MD device, then its device node /dev/mdX may still
exist afterwards or it is recreated by udev. The next open() call
can lead to creation of an inoperable MD device. The reason for
this is that a change event (KOBJ_CHANGE) is sent to udev which
races against the remove event (KOBJ_REMOVE) from md_free().
So drop sending the change event.

A change is likely also required in mdadm as many versions send the
change event to udev as well.

Signed-off-by: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
---
 drivers/md/md.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index e55e6cf..464627b 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5671,7 +5671,6 @@ static int do_md_stop(struct mddev *mddev, int mode,
 		export_array(mddev);
 
 		md_clean(mddev);
-		kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE);
 		if (mddev->hold_active == UNTIL_STOP)
 			mddev->hold_active = 0;
 	}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-02-19 21:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-17 16:25 [PATCH] md: Drop sending a change uevent when stopping Sebastian Parschauer
2016-02-17 18:19 ` Shaohua Li
2016-02-17 21:29   ` NeilBrown
2016-02-17 22:14     ` Shaohua Li
2016-02-18  6:45     ` Hannes Reinecke
2016-02-18 23:06       ` NeilBrown
2016-02-19 21:58         ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).