md: revert the recent addition of a call to the BLKRRPART ioctl.
authorNeilBrown <neilb@suse.de>
Thu, 6 Nov 2008 06:28:01 +0000 (17:28 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 6 Nov 2008 06:28:01 +0000 (17:28 +1100)
It turns out that it is only safe to call blkdev_ioctl when the device
is actually open (as ->bd_disk is set to NULL on last close).  And it
is quite possible for do_md_stop to be called when the device is not
open.  So discard the call to blkdev_ioctl(BLKRRPART) which was
added in
   commit 934d9c23b4c7e31840a895ba4b7e88d6413c81f3

It is just as easy to call this ioctl from userspace when needed (on
mdadm -S) so leave it out of the kernel

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c

index 9abf6ed..1b1d326 100644 (file)
@@ -3884,7 +3884,6 @@ 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));
 
@@ -3941,11 +3940,6 @@ 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)