]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: allow a reshape operation to be reversed.
authorNeilBrown <neilb@suse.de>
Thu, 12 Apr 2012 06:12:19 +0000 (16:12 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 12 Apr 2012 06:12:19 +0000 (16:12 +1000)
commit983b04779dafd3d4681128dab9612eac0a7379f9
treefc28260f9db20362e9357f07f76fecfb317b5768
parentafbaa90b80b1ec66e5137cc3824746bfdf559b18
md: allow a reshape operation to be reversed.

Currently a reshape operation always progresses from the start
of the array to the end unless the number of devices is being
reduced, in which case it progressed in the opposite direction.

To reverse a partial reshape which changes the number of devices
you can stop the array and re-assemble with the raid-disks numbers
reversed and it will undo.

However for a reshape that does not change the number of devices
it is not possible to reverse the reshape in the middle - you have to
wait until it completes.

So add a 'reshape_direction' attribute with is either 'forwards' or
'backwards' and can be explicitly set when delta_disks is zero.

This will become more important when we allow the data_offset to
change in a reshape.  Then the explicit statement of what direction is
being used will be more useful.

This can be enabled in raid5 trivially as it already supports
reverse reshape and just needs to use a different trigger to request it.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c
drivers/md/md.h
drivers/md/raid5.c
include/linux/raid/md_p.h