summaryrefslogtreecommitdiff
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2017-02-24 11:15:23 +0800
committerShaohua Li <shli@fb.com>2017-03-09 09:02:18 -0800
commitc94836342192b05d599d6aa3397f732f7a238689 (patch)
tree17c6407285ffbc1e1c75302b66338b84bb592831 /drivers/md/md.c
parent75df023f4f2188c21181996e28234fef9351ef45 (diff)
md: move funcs from pers->resize to update_size
raid1_resize and raid5_resize should also check the mddev->queue if run underneath dm-raid. And both set_capacity and revalidate_disk are used in pers->resize such as raid1, raid10 and raid5. So move them from personality file to common code. Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 82bd1f3d2b19..bd15a18485c8 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6525,8 +6525,12 @@ static int update_size(struct mddev *mddev, sector_t num_sectors)
return -ENOSPC;
}
rv = mddev->pers->resize(mddev, num_sectors);
- if (!rv)
- revalidate_disk(mddev->gendisk);
+ if (!rv) {
+ if (mddev->queue) {
+ set_capacity(mddev->gendisk, mddev->array_sectors);
+ revalidate_disk(mddev->gendisk);
+ }
+ }
return rv;
}