diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-30 21:36:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-30 21:36:16 -0400 |
commit | 721d5dfe7e516954c501d5e9d0dfab379cf4241a (patch) | |
tree | 3056d4ffeecd171cf9f091437e721d2556e63c6d /drivers/md | |
parent | f2347dfcd14fd9e30714656cb27be2b7abe59c63 (diff) | |
parent | 934d9c23b4c7e31840a895ba4b7e88d6413c81f3 (diff) |
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/md')
-rw-r--r-- | drivers/md/md.c | 7 |
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) | |||
3884 | if (mode == 0) { | 3884 | if (mode == 0) { |
3885 | mdk_rdev_t *rdev; | 3885 | mdk_rdev_t *rdev; |
3886 | struct list_head *tmp; | 3886 | struct list_head *tmp; |
3887 | struct block_device *bdev; | ||
3887 | 3888 | ||
3888 | printk(KERN_INFO "md: %s stopped.\n", mdname(mddev)); | 3889 | printk(KERN_INFO "md: %s stopped.\n", mdname(mddev)); |
3889 | 3890 | ||
@@ -3940,6 +3941,12 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
3940 | mddev->degraded = 0; | 3941 | mddev->degraded = 0; |
3941 | mddev->barriers_work = 0; | 3942 | mddev->barriers_work = 0; |
3942 | mddev->safemode = 0; | 3943 | mddev->safemode = 0; |
3944 | bdev = bdget_disk(mddev->gendisk, 0); | ||
3945 | if (bdev) { | ||
3946 | blkdev_ioctl(bdev, 0, BLKRRPART, 0); | ||
3947 | bdput(bdev); | ||
3948 | } | ||
3949 | kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE); | ||
3943 | 3950 | ||
3944 | } else if (mddev->pers) | 3951 | } else if (mddev->pers) |
3945 | printk(KERN_INFO "md: %s switched to read-only mode.\n", | 3952 | printk(KERN_INFO "md: %s switched to read-only mode.\n", |