Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b506335e authored by Shaohua Li's avatar Shaohua Li
Browse files

md/raid10: skip spare disk as 'first' disk



Commit 6f287ca6(md/raid10: reset the 'first' at the end of loop) ignores
a case in reshape, the first rdev could be a spare disk, which shouldn't
be accounted as the first disk since it doesn't include the offset info.

Fix: 6f287ca6(md/raid10: reset the 'first' at the end of loop)
Cc: Guoqing Jiang <gqjiang@suse.com>
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent 43ac9b84
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4079,9 +4079,9 @@ static int raid10_start_reshape(struct mddev *mddev)
				diff = 0;
			if (first || diff < min_offset_diff)
				min_offset_diff = diff;
		}
			first = 0;
		}
	}

	if (max(before_length, after_length) > min_offset_diff)
		return -EINVAL;