summaryrefslogtreecommitdiffstats
path: root/bitmap.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2015-12-01 17:30:12 +0100
committerNeilBrown <neilb@suse.com>2015-12-16 03:24:04 +0100
commit53e76b1def4d3d6c884e45f1ac723b5f3a1b7376 (patch)
tree3398e83cfb308681f6cff2eb17cc0d88a6d12912 /bitmap.c
parentmdadm: don't show cluster name once the bitmap is cleared (diff)
downloadmdadm-53e76b1def4d3d6c884e45f1ac723b5f3a1b7376.tar.xz
mdadm-53e76b1def4d3d6c884e45f1ac723b5f3a1b7376.zip
mdadm: do not display bitmap info if it is cleared
"mdadm -X DISK" is used to report information about a bitmap file, it is better to not display all the related infos if bitmap is cleared with "--bitmap=none" under grow mode. To do that, the locate_bitmap is changed a little to have a return value based on MD_FEATURE_BITMAP_OFFSET. Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'bitmap.c')
-rw-r--r--bitmap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bitmap.c b/bitmap.c
index 803eda38..dab674b4 100644
--- a/bitmap.c
+++ b/bitmap.c
@@ -221,8 +221,12 @@ int bitmap_file_open(char *filename, struct supertype **stp)
pr_err("No bitmap possible with %s metadata\n",
st->ss->name);
return -1;
- } else
- st->ss->locate_bitmap(st, fd);
+ } else {
+ if (st->ss->locate_bitmap(st, fd)) {
+ pr_err("%s doesn't have bitmap\n", filename);
+ fd = -1;
+ }
+ }
*stp = st;
} else {