]> git.ipfire.org Git - thirdparty/mdadm.git/commit
Grow: fix can't change bitmap type from none to clustered.
authorHeming Zhao <heming.zhao@suse.com>
Thu, 23 Feb 2023 14:39:39 +0000 (22:39 +0800)
committerJes Sorensen <jes@trained-monkey.org>
Thu, 23 Feb 2023 18:23:26 +0000 (13:23 -0500)
commitd07e561810a2e33b667a8a9476edaff42eb119b9
treeabe74458156206a4adf2950b1cbcad241a72e80e
parent28a083955c6f58f8e582734c8c82aff909a7d461
Grow: fix can't change bitmap type from none to clustered.

Commit a042210648ed ("disallow create or grow clustered bitmap with
writemostly set") introduced this bug. We should use 'true' logic not
'== 0' to deny setting up clustered array under WRITEMOSTLY condition.

How to trigger

```
~/mdadm # ./mdadm -Ss && ./mdadm --zero-superblock /dev/sd{a,b}
~/mdadm # ./mdadm -C /dev/md0 -l mirror -b clustered -e 1.2 -n 2 \
/dev/sda /dev/sdb --assume-clean
mdadm: array /dev/md0 started.
~/mdadm # ./mdadm --grow /dev/md0 --bitmap=none
~/mdadm # ./mdadm --grow /dev/md0 --bitmap=clustered
mdadm: /dev/md0 disks marked write-mostly are not supported with clustered bitmap
```

Signed-off-by: Heming Zhao <heming.zhao@suse.com>
Acked-by: Coly Li <colyli@suse.de>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Grow.c