aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e636e404e9a5..f539b587ca72 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1947,8 +1947,6 @@ static int lock_rdev(mdk_rdev_t *rdev, dev_t dev, int shared)
1947 __bdevname(dev, b)); 1947 __bdevname(dev, b));
1948 return PTR_ERR(bdev); 1948 return PTR_ERR(bdev);
1949 } 1949 }
1950 if (!shared)
1951 set_bit(AllReserved, &rdev->flags);
1952 rdev->bdev = bdev; 1950 rdev->bdev = bdev;
1953 return err; 1951 return err;
1954} 1952}
@@ -2610,12 +2608,11 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
2610 2608
2611 mddev_lock(mddev); 2609 mddev_lock(mddev);
2612 list_for_each_entry(rdev2, &mddev->disks, same_set) 2610 list_for_each_entry(rdev2, &mddev->disks, same_set)
2613 if (test_bit(AllReserved, &rdev2->flags) || 2611 if (rdev->bdev == rdev2->bdev &&
2614 (rdev->bdev == rdev2->bdev && 2612 rdev != rdev2 &&
2615 rdev != rdev2 && 2613 overlaps(rdev->data_offset, rdev->sectors,
2616 overlaps(rdev->data_offset, rdev->sectors, 2614 rdev2->data_offset,
2617 rdev2->data_offset, 2615 rdev2->sectors)) {
2618 rdev2->sectors))) {
2619 overlap = 1; 2616 overlap = 1;
2620 break; 2617 break;
2621 } 2618 }