提交 e56108d6 编写于 作者: N NeilBrown

md/raid5: be careful not to resize_stripes too big.

When a RAID5 is reshaping, conf->raid_disks is increased
before mddev->delta_disks becomes zero.
This can result in check_reshape calling resize_stripes with a
number that is too large.  This particularly happens
when md_check_recovery calls ->check_reshape().

If we use ->previous_raid_disks, we don't risk this.
Signed-off-by: NNeilBrown <neilb@suse.de>
上级 db07d85e
...@@ -5871,7 +5871,8 @@ static int check_reshape(struct mddev *mddev) ...@@ -5871,7 +5871,8 @@ static int check_reshape(struct mddev *mddev)
if (!check_stripe_cache(mddev)) if (!check_stripe_cache(mddev))
return -ENOSPC; return -ENOSPC;
return resize_stripes(conf, conf->raid_disks + mddev->delta_disks); return resize_stripes(conf, (conf->previous_raid_disks
+ mddev->delta_disks));
} }
static int raid5_start_reshape(struct mddev *mddev) static int raid5_start_reshape(struct mddev *mddev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册