]> git.ipfire.org Git - thirdparty/mdadm.git/commit
disallow create or grow clustered bitmap with writemostly set
authorNigel Croxon <ncroxon@redhat.com>
Mon, 23 Aug 2021 12:48:35 +0000 (08:48 -0400)
committerJes Sorensen <jsorensen@fb.com>
Fri, 8 Oct 2021 15:47:55 +0000 (11:47 -0400)
commita042210648ed83a34d987871911a776b5b09cdc5
treebc90108b0ff2c6522bc486861e9db7f8ee3d8c37
parentcf16a350552ed853d7228f5ebfa3353a7e0538c9
disallow create or grow clustered bitmap with writemostly set

Do not support creating an MD array on a clustered system
(--bitmap=clustered) and disks with the write mostly
(--write-mostly) flag set.

Or do not grow an MD array on a non-clustered bitmap to a
clustered bitmap with disks having the write mostly flag set.

The actual results is the MD array is created successfully.
But the expected results should be a failure with an
error message stating:
Can not set --write-mostly with a clustered bitmap.
and disks marked write-mostly are not supported with clustered bitmap.

V2:
Added the device name in the error message during creation:
mdadm -CR /dev/md0 -l1 --raid-devices=2 /dev/sda --write-mostly /dev/sdb --bitmap=clustered
mdadm: Can not set /dev/sdb --write-mostly with a clustered bitmap.

Added the array name in the error message when growing:
mdadm --grow /dev/md0 --bitmap=clustered
mdadm: /dev/md0 disks marked write-mostly are not supported with clustered bitmap

Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Create.c
Grow.c