summaryrefslogtreecommitdiff
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2017-04-06 09:12:18 +0800
committerShaohua Li <shli@fb.com>2017-04-10 10:41:50 -0700
commit6f287ca6046edd34ed83aafb7f9033c9c2e809e2 (patch)
tree23f7834dfb9a01e0cf70efdad3a8e7aee771610a /drivers/md/raid10.c
parent7471fb77ce4dc4cb81291189947fcdf621a97987 (diff)
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: NeilBrown <neilb@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 0f13d57ef646..e055ec94b9a8 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -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)