[PATCH 2/2] mdadm: output info more precisely when change bitmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When change bitmap to none, the infos could be more accurate
based on existed state 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 present.
    
Signed-off-by: Guoqing Jiang <gqjiang@xxxxxxxx>
---
 Grow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Grow.c b/Grow.c
index 80d7b22..30ff7f3 100644
--- 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;
 	}
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux