diff options
author | Guoqing Jiang <gqjiang@suse.com> | 2016-05-04 10:33:44 +0200 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-05-09 20:59:05 +0200 |
commit | 261b57fe219f7ebd37cf903c3696e9ea558536eb (patch) | |
tree | 2aca8fb58393ad61796158f3b78579ad8937266f /super1.c | |
parent | Create: check the node nums when create clustered raid (diff) | |
download | mdadm-261b57fe219f7ebd37cf903c3696e9ea558536eb.tar.xz mdadm-261b57fe219f7ebd37cf903c3696e9ea558536eb.zip |
super1: don't update node nums if it is not more than 1
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>
Diffstat (limited to 'super1.c')
-rw-r--r-- | super1.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -2394,6 +2394,11 @@ static int write_bitmap1(struct supertype *st, int fd, enum bitmap_update update 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); |