diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 5ed2228745cb..bde3e9682250 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1301,6 +1301,7 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) | |||
1301 | else | 1301 | else |
1302 | ko = &rdev->bdev->bd_disk->kobj; | 1302 | ko = &rdev->bdev->bd_disk->kobj; |
1303 | sysfs_create_link(&rdev->kobj, ko, "block"); | 1303 | sysfs_create_link(&rdev->kobj, ko, "block"); |
1304 | bd_claim_by_disk(rdev->bdev, rdev, mddev->gendisk); | ||
1304 | return 0; | 1305 | return 0; |
1305 | } | 1306 | } |
1306 | 1307 | ||
@@ -1311,6 +1312,7 @@ static void unbind_rdev_from_array(mdk_rdev_t * rdev) | |||
1311 | MD_BUG(); | 1312 | MD_BUG(); |
1312 | return; | 1313 | return; |
1313 | } | 1314 | } |
1315 | bd_release_from_disk(rdev->bdev, rdev->mddev->gendisk); | ||
1314 | list_del_init(&rdev->same_set); | 1316 | list_del_init(&rdev->same_set); |
1315 | printk(KERN_INFO "md: unbind<%s>\n", bdevname(rdev->bdev,b)); | 1317 | printk(KERN_INFO "md: unbind<%s>\n", bdevname(rdev->bdev,b)); |
1316 | rdev->mddev = NULL; | 1318 | rdev->mddev = NULL; |