mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
b5e1b8cee7
commit
2c810cddc4
4 changed files with 84 additions and 14 deletions
|
@ -281,10 +281,15 @@ struct mdp_superblock_1 {
|
|||
* active device with same 'role'.
|
||||
* 'recovery_offset' is also set.
|
||||
*/
|
||||
#define MD_FEATURE_RESHAPE_BACKWARDS 32 /* Reshape doesn't change number
|
||||
* of devices, but is going
|
||||
* backwards anyway.
|
||||
*/
|
||||
#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \
|
||||
|MD_FEATURE_RECOVERY_OFFSET \
|
||||
|MD_FEATURE_RESHAPE_ACTIVE \
|
||||
|MD_FEATURE_BAD_BLOCKS \
|
||||
|MD_FEATURE_REPLACEMENT)
|
||||
|MD_FEATURE_REPLACEMENT \
|
||||
|MD_FEATURE_RESHAPE_BACKWARDS)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue