]> asedeno.scripts.mit.edu Git - linux.git/commit
md: be cautious about using ->curr_resync_completed for ->recovery_offset
authorNeilBrown <neilb@suse.com>
Tue, 17 Oct 2017 05:18:36 +0000 (16:18 +1100)
committerShaohua Li <shli@fb.com>
Thu, 9 Nov 2017 15:29:40 +0000 (07:29 -0800)
commitdb0505d320660b6ad92418847e7eca6b61b246ac
tree816133610b277b2b24fd682370b36861bb6461ec
parent39b4954c0a1556f8f7f1fdcf59a227117fcd8a0b
md: be cautious about using ->curr_resync_completed for ->recovery_offset

The ->recovery_offset shows how much of a non-InSync device is actually
in sync - how much has been recoveryed.

When performing a recovery, ->curr_resync and ->curr_resync_completed
follow the device address being recovered and so can be used to update
->recovery_offset.

When performing a reshape, ->curr_resync* might follow the device
addresses (raid5) or might follow array addresses (raid10), so cannot
in general be used to set ->recovery_offset.  When reshaping backwards,
->curre_resync* measures from the *end* of the array-or-device, so is
particularly unhelpful.

So change the common code in md.c to only use ->curr_resync_complete
for the simple recovery case, and add code to raid5.c to update
->recovery_offset during a forwards reshape.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md.c
drivers/md/raid5.c