dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/dont-allow-array-geometry-change-with-ppl-enabled.patch

2c1b57
commit b208f817ec538e56df7280f0353e6bda532b9432
2c1b57
Author: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
2c1b57
Date:   Thu Jun 8 16:05:51 2017 +0200
2c1b57
2c1b57
    Grow: don't allow array geometry change with ppl enabled
2c1b57
    
2c1b57
    Don't allow array geometry change (size expand, disk adding) when PPL
2c1b57
    consistency policy is enabled. Current PPL implementation doesn't work when
2c1b57
    reshape is taking place.
2c1b57
    
2c1b57
    Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
2c1b57
    Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
2c1b57
diff --git a/Grow.c b/Grow.c
2c1b57
index 4ecb1d8..f7325cb 100644
2c1b57
--- a/Grow.c
2c1b57
+++ b/Grow.c
2c1b57
@@ -1880,6 +1880,13 @@ int Grow_reshape(char *devname, int fd,
2c1b57
 					free(subarray);
2c1b57
 					return 1;
2c1b57
 				}
2c1b57
+				if (content->consistency_policy ==
2c1b57
+				    CONSISTENCY_POLICY_PPL) {
2c1b57
+					pr_err("Operation not supported when ppl consistency policy is enabled\n");
2c1b57
+					sysfs_free(cc);
2c1b57
+					free(subarray);
2c1b57
+					return 1;
2c1b57
+				}
2c1b57
 			}
2c1b57
 			sysfs_free(cc);
2c1b57
 		}