[PATCH] mdadm: add checking the clustered bitmap in assemble mode

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

 



1. both clustered and internal array don't need to specify
--bitmap when assembling array.
2. clustered array doesn't support external bitmap mode.

Signed-off-by: Zhilong Liu <zlliu@xxxxxxxx>

diff --git a/mdadm.c b/mdadm.c
index b5d89e4..b08cace 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1095,8 +1095,14 @@ int main(int argc, char *argv[])
 				pr_err("bitmap file needed with -b in --assemble mode\n");
 				exit(2);
 			}
-			if (strcmp(optarg, "internal") == 0) {
-				pr_err("there is no need to specify --bitmap when assembling arrays with internal bitmaps\n");
+			if (strcmp(optarg, "internal") == 0 ||
+			    strcmp(optarg, "clustered") == 0) {
+				pr_err("no need to specify --bitmap when assembling arrays with internal or clustered bitmaps\n");
+				continue;
+			}
+			if (strcmp(optarg, "clustered") == 0 &&
+			    strchr(optarg, '/') != NULL) {
+				pr_err("clustered array doesn't support external bitmap\n");
 				continue;
 			}
 			bitmap_fd = open(optarg, O_RDWR);
-- 
2.6.6

--
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