summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-31 02:36:16 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-31 02:36:16 +0100
commit721d5dfe7e516954c501d5e9d0dfab379cf4241a (patch)
tree3056d4ffeecd171cf9f091437e721d2556e63c6d /drivers
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus (diff)
parentmd: destroy partitions and notify udev when md array is stopped. (diff)
downloadlinux-721d5dfe7e516954c501d5e9d0dfab379cf4241a.tar.xz
linux-721d5dfe7e516954c501d5e9d0dfab379cf4241a.zip
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md: md: destroy partitions and notify udev when md array is stopped.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b4162f6f1b79..9abf6ed16535 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3884,6 +3884,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
if (mode == 0) {
mdk_rdev_t *rdev;
struct list_head *tmp;
+ struct block_device *bdev;
printk(KERN_INFO "md: %s stopped.\n", mdname(mddev));
@@ -3940,6 +3941,12 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
mddev->degraded = 0;
mddev->barriers_work = 0;
mddev->safemode = 0;
+ bdev = bdget_disk(mddev->gendisk, 0);
+ if (bdev) {
+ blkdev_ioctl(bdev, 0, BLKRRPART, 0);
+ bdput(bdev);
+ }
+ kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE);
} else if (mddev->pers)
printk(KERN_INFO "md: %s switched to read-only mode.\n",