]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix regression when using 'grow' to add a bitmap.
authorNeilBrown <neilb@suse.de>
Tue, 15 Mar 2011 05:31:20 +0000 (16:31 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 15 Mar 2011 05:31:20 +0000 (16:31 +1100)
When we allowed a devlist to accompany some --grow modes - but not
--bitmap - we made --bitmap always fail, in stead of fail of a device
was given to add.
As 'devs_found' includes the md device, we need to  compare against
'1'.

Signed-off-by: NeilBrown <neilb@suse.de>
mdadm.c

diff --git a/mdadm.c b/mdadm.c
index c44c43228067c536eeccd18d2480310bc0dac444..e01beec226b23e243b7aa382e33498cca2358a49 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -1646,7 +1646,7 @@ int main(int argc, char *argv[])
                        }
                } else if (bitmap_file) {
                        if (size >= 0 || raiddisks || chunk ||
-                           layout_str != NULL || devs_found) {
+                           layout_str != NULL || devs_found > 1) {
                                fprintf(stderr, Name ": --bitmap changes cannot be "
                                        "used with other geometry changes "
                                        "in --grow mode\n");