Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://neil.brown.name/md
Browse files Browse the repository at this point in the history
* 'for-linus' of git://neil.brown.name/md:
  md: destroy partitions and notify udev when md array is stopped.
  • Loading branch information
Linus Torvalds committed Oct 31, 2008
2 parents f2347df + 934d9c2 commit 721d5df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 721d5df

Please sign in to comment.