diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 13 | ||||
-rw-r--r-- | drivers/md/md.h | 2 |
2 files changed, 5 insertions, 10 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 | } |
diff --git a/drivers/md/md.h b/drivers/md/md.h index eec517ced31a..7e90b8593b2a 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -93,8 +93,6 @@ struct mdk_rdev_s | |||
93 | #define Faulty 1 /* device is known to have a fault */ | 93 | #define Faulty 1 /* device is known to have a fault */ |
94 | #define In_sync 2 /* device is in_sync with rest of array */ | 94 | #define In_sync 2 /* device is in_sync with rest of array */ |
95 | #define WriteMostly 4 /* Avoid reading if at all possible */ | 95 | #define WriteMostly 4 /* Avoid reading if at all possible */ |
96 | #define AllReserved 6 /* If whole device is reserved for | ||
97 | * one array */ | ||
98 | #define AutoDetected 7 /* added by auto-detect */ | 96 | #define AutoDetected 7 /* added by auto-detect */ |
99 | #define Blocked 8 /* An error occured on an externally | 97 | #define Blocked 8 /* An error occured on an externally |
100 | * managed array, don't allow writes | 98 | * managed array, don't allow writes |