summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2015-12-02 00:30:10 +0800
committerNeilBrown <neilb@suse.com>2015-12-16 13:23:58 +1100
commit37d0ca9be68e4a677bac02a5dde9a87f20110739 (patch)
tree11940f6127d0f2a775dfc93720330feb33b44cad
parent41dbb4da227946441ebb7d211bae06dbfac311b8 (diff)
downloadmdadm-37d0ca9be68e4a677bac02a5dde9a87f20110739.tar.gz
mdadm: output info more precisely when change bitmap to none
WHen change bitmap to none, the infos could be more accurate based on existed bitmap type. And s->bitmap_file is passed from cmd "--bitmap=TYPE", so remove s->bitmap_file from err info since it should means change the bitmap to one type failed rather than the type is already presented. Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.com>
-rwxr-xr-xGrow.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Grow.c b/Grow.c
index ee48c36..6dfb9c9 100755
--- a/Grow.c
+++ b/Grow.c
@@ -328,12 +328,15 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s)
if (strcmp(s->bitmap_file, "none")==0) {
array.state &= ~(1<<MD_SB_BITMAP_PRESENT);
if (ioctl(fd, SET_ARRAY_INFO, &array)!= 0) {
- pr_err("failed to remove internal bitmap.\n");
+ if (array.state & (1<<MD_SB_CLUSTERED))
+ pr_err("failed to remove clustered bitmap.\n");
+ else
+ pr_err("failed to remove internal bitmap.\n");
return 1;
}
return 0;
}
- pr_err("%s bitmap already present on %s\n", s->bitmap_file, devname);
+ pr_err("bitmap already present on %s\n", devname);
return 1;
}