提交 6f287ca6 编写于 作者: G Guoqing Jiang 提交者: Shaohua Li

md/raid10: reset the 'first' at the end of loop

We need to set "first = 0' at the end of rdev_for_each
loop, so we can get the array's min_offset_diff correctly
otherwise min_offset_diff just means the last rdev's
offset diff.
Suggested-by: NNeilBrown <neilb@suse.com>
Signed-off-by: NGuoqing Jiang <gqjiang@suse.com>
Reviewed-by: NNeilBrown <neilb@suse.com>
Signed-off-by: NShaohua Li <shli@fb.com>
上级 7471fb77
......@@ -3769,6 +3769,7 @@ static int raid10_run(struct mddev *mddev)
if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
discard_supported = true;
first = 0;
}
if (mddev->queue) {
......@@ -4172,6 +4173,7 @@ static int raid10_start_reshape(struct mddev *mddev)
if (first || diff < min_offset_diff)
min_offset_diff = diff;
}
first = 0;
}
if (max(before_length, after_length) > min_offset_diff)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册