aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index d002b8301fc2..2b5928976095 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1182,6 +1182,7 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1182{ 1182{
1183 mdk_rdev_t *same_pdev; 1183 mdk_rdev_t *same_pdev;
1184 char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; 1184 char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE];
1185 struct kobject *ko;
1185 1186
1186 if (rdev->mddev) { 1187 if (rdev->mddev) {
1187 MD_BUG(); 1188 MD_BUG();
@@ -1221,7 +1222,11 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1221 rdev->kobj.parent = &mddev->kobj; 1222 rdev->kobj.parent = &mddev->kobj;
1222 kobject_add(&rdev->kobj); 1223 kobject_add(&rdev->kobj);
1223 1224
1224 sysfs_create_link(&rdev->kobj, &rdev->bdev->bd_disk->kobj, "block"); 1225 if (rdev->bdev->bd_part)
1226 ko = &rdev->bdev->bd_part->kobj;
1227 else
1228 ko = &rdev->bdev->bd_disk->kobj;
1229 sysfs_create_link(&rdev->kobj, ko, "block");
1225 return 0; 1230 return 0;
1226} 1231}
1227 1232