Re: mdadm: Patch to restrict --size when shrinking unless forced
From: NeilBrown <hidden>
Date: 2017-10-10 20:48:55
Attachments
- signature.asc [application/pgp-signature] 832 bytes
From: NeilBrown <hidden>
Date: 2017-10-10 20:48:55
On Mon, Oct 09 2017, Phil Turmel wrote:
On 10/09/2017 12:10 AM, NeilBrown wrote:quoted
If there is some action that mdadm can currently be told to perform, and when it tries to perform that action it corrupts the array, then it is certainly appropriate to teach mdadm not to perform that action. It shouldn't even perform that action with --force. I agree that changing mdadm like this is complementary to changing the kernel. Both are useful.A certain amount of the trouble with all of this is the english meaning of "grow" doesn't really match what mdadm allows. Might it be reasonable to reject "--grow" operations that reduce the final array size, and introduce the complementary "--reduce" operation that rejects array size increases?
While there is a lot to like about this approach, one problem is that some "grow" operations do not change the size. They might, e.g., just change the chunksize. I guess you could have --grow --reduce --reshape. I wouldn't object to such a change. Thanks, NeilBrown
Both operations would share the current code, just apply a different sanity check before proceeding. mdadm would then at least not violate the rule of least surprise. Phil