diff options
author | Guoqing Jiang <gqjiang@suse.com> | 2015-12-01 17:30:12 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-12-16 03:24:04 +0100 |
commit | 53e76b1def4d3d6c884e45f1ac723b5f3a1b7376 (patch) | |
tree | 3398e83cfb308681f6cff2eb17cc0d88a6d12912 /super0.c | |
parent | mdadm: don't show cluster name once the bitmap is cleared (diff) | |
download | mdadm-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 'super0.c')
-rw-r--r-- | super0.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1155,16 +1155,16 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp, return 1; } -static void locate_bitmap0(struct supertype *st, int fd) +static int locate_bitmap0(struct supertype *st, int fd) { unsigned long long dsize; unsigned long long offset; if (!get_dev_size(fd, NULL, &dsize)) - return; + return -1; if (dsize < MD_RESERVED_SECTORS*512) - return; + return -1; offset = MD_NEW_SIZE_SECTORS(dsize>>9); @@ -1173,6 +1173,7 @@ static void locate_bitmap0(struct supertype *st, int fd) offset += MD_SB_BYTES; lseek64(fd, offset, 0); + return 0; } static int write_bitmap0(struct supertype *st, int fd, enum bitmap_update update) |