Skip to contentSkip to conversation

mdadm: make create clustered raid10 possible

PATCH Superseded Guoqing Jiang 4 participants 5 messages Oct 24, 2017 – Oct 30, 2017 MD RAID

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mdadm: make create clustered raid10 possible

This change to make we can create a clustered
raid10 array as well.

---
 mdadm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
mdadm.c +3 -2
index 7cdcdba7c652..60d80e0103f4 100644
@@ -1542,8 +1542,9 @@ int main(int argc, char *argv[])
 				break;
 			}
 
-			if (s.level != 1) {
-				pr_err("--bitmap=clustered is currently supported with RAID mirror only\n");
+			if (s.level != 1 && s.level != 10) {
+				pr_err("--bitmap=clustered is currently "
+				       "supported with raid1/10 only\n");
 				rv = 1;
 				break;
 			}
Signature · 1 line
2.10.0
#1 lore raw
Quoted 13 lines · Guoqing Jiang

This change to make we can create a clustered
raid10 array as well.

---
 mdadm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
mdadm.c +0 -0
index 7cdcdba7c652..60d80e0103f4 100644

mdadm.c int main(int argc, char *argv[]) · line 1547

Quoted 8 lines
mdadm.c +3 -2
@@ -1542,8 +1542,9 @@ int main(int argc, char *argv[])
 				break;
 			}
 
-			if (s.level != 1) {
-				pr_err("--bitmap=clustered is currently supported with RAID mirror only\n");
+			if (s.level != 1 && s.level != 10) {
+				pr_err("--bitmap=clustered is currently "
+				       "supported with raid1/10 only\n");

Please don't wrap strings. It makes it hard to search for them. Long line might be bad, but wrapped strings are worse.

Thanks,
NeilBrown

Quoted 10 lines
mdadm.c +0 -0
 				rv = 1;
 				break;
 			}
Signature · 6 lines
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 18 lines · NeilBrown
Quoted 16 lines · Guoqing Jiang

This change to make we can create a clustered
raid10 array as well.

---
  mdadm.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
mdadm.c +0 -0
index 7cdcdba7c652..60d80e0103f4 100644
@@ -1542,8 +1542,9 @@ int main(int argc, char *argv[])
  				break;
  			}
 
Quoted 9 lines

mdadm.c int main(int argc, char *argv[]) · line 1547

Quoted 5 lines
mdadm.c +3 -2
-			if (s.level != 1) {
-				pr_err("--bitmap=clustered is currently supported with RAID mirror only\n");
+			if (s.level != 1 && s.level != 10) {
+				pr_err("--bitmap=clustered is currently "
+				       "supported with raid1/10 only\n");

Please don't wrap strings. It makes it hard to search for them. Long line might be bad, but wrapped strings are worse.

Personally I actually prefer the wrapped strings over the long lines, but given the kernel consensus is not to wrap, I apply that rule to mdadm as well.

Cheers,
Jes

#3 lore raw
In reply to Guoqing Jiang
Quoted 13 lines · Guoqing Jiang

This change to make we can create a clustered
raid10 array as well.

---
 mdadm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
mdadm.c +0 -0
index 7cdcdba7c652..60d80e0103f4 100644

mdadm.c int main(int argc, char *argv[]) · line 1549

Quoted 10 lines
mdadm.c +3 -2
@@ -1542,8 +1542,9 @@ int main(int argc, char *argv[])
 				break;
 			}
 
-			if (s.level != 1) {
-				pr_err("--bitmap=clustered is currently supported with RAID mirror only\n");
+			if (s.level != 1 && s.level != 10) {
+				pr_err("--bitmap=clustered is currently "
+				       "supported with raid1/10 only\n");
 				rv = 1;
 				break;

Since kernel only supports near layout for raid10 cluster, probably check the layout in mdadm too?

#4 lore raw
Quoted 17 lines · Shaohua Li
Quoted 16 lines · Guoqing Jiang

This change to make we can create a clustered
raid10 array as well.

---
  mdadm.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
mdadm.c +0 -0
index 7cdcdba7c652..60d80e0103f4 100644
@@ -1542,8 +1542,9 @@ int main(int argc, char *argv[])
  				break;
  			}
 
Quoted 9 lines

mdadm.c int main(int argc, char *argv[]) · line 1549

Quoted 7 lines
mdadm.c +3 -2
-			if (s.level != 1) {
-				pr_err("--bitmap=clustered is currently supported with RAID mirror only\n");
+			if (s.level != 1 && s.level != 10) {
+				pr_err("--bitmap=clustered is currently "
+				       "supported with raid1/10 only\n");
  				rv = 1;
  				break;

Since kernel only supports near layout for raid10 cluster, probably check the layout in mdadm too?

The changes in raid10_run has ensured only near layout is possible for clustered raid10. Anyway, I will add the check either.

Thanks,
Guoqing