We at least need two nodes for cluster raid so make the
check before update node nums.
Reported-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
return -EINVAL;
}
+ if (bms->version == BITMAP_MAJOR_CLUSTERED && st->nodes <= 1) {
+ pr_err("Warning: cluster-md at least needs two nodes\n");
+ return -EINVAL;
+ }
+
/* Each node has an independent bitmap, it is necessary to calculate the
* space is enough or not, first get how many bytes for the total bitmap */
bm_space_per_node = calc_bitmap_size(bms, 4096);