diff options
author | NeilBrown <neilb@suse.de> | 2013-07-01 07:10:05 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-07-01 07:10:05 +0200 |
commit | 2eba849621011a5160b4597f82aa4ed0de7d4e64 (patch) | |
tree | bc692036f3889927542d9d0d1b12a8b305e082f9 /lib.c | |
parent | New function: sysfs_wait (diff) | |
download | mdadm-2eba849621011a5160b4597f82aa4ed0de7d4e64.tar.xz mdadm-2eba849621011a5160b4597f82aa4ed0de7d4e64.zip |
Manage: check alignment when stopping an array undergoing reshape.
To be able to revert-reshape of raid4/5/6 which is changing
the number of devices, the reshape must has been stopped on a multiple
of the old and new stripe sizes.
The kernel only enforces the new stripe size multiple.
So we enforce the old-stripe-size multiple by careful use of
"sync_max" and monitoring "reshape_position".
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -396,3 +396,14 @@ int use_udev(void) } return use; } + +unsigned long GCD(unsigned long a, unsigned long b) +{ + while (a != b) { + if (a < b) + b -= a; + if (b < a) + a -= b; + } + return a; +} |