aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c40ce9f9cc9b..50ab4a936e30 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4045,11 +4045,8 @@ static int update_size(mddev_t *mddev, unsigned long size)
4045 return -EBUSY; 4045 return -EBUSY;
4046 ITERATE_RDEV(mddev,rdev,tmp) { 4046 ITERATE_RDEV(mddev,rdev,tmp) {
4047 sector_t avail; 4047 sector_t avail;
4048 if (rdev->sb_offset > rdev->data_offset) 4048 avail = rdev->size * 2;
4049 avail = (rdev->sb_offset*2) - rdev->data_offset; 4049
4050 else
4051 avail = get_capacity(rdev->bdev->bd_disk)
4052 - rdev->data_offset;
4053 if (fit && (size == 0 || size > avail/2)) 4050 if (fit && (size == 0 || size > avail/2))
4054 size = avail/2; 4051 size = avail/2;
4055 if (avail < ((sector_t)size << 1)) 4052 if (avail < ((sector_t)size << 1))