summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorLukasz Florczak <lukasz.florczak@linux.intel.com>2022-06-15 14:28:39 +0200
committerJes Sorensen <jsorensen@fb.com>2022-06-24 20:09:38 +0200
commit70f1ff4291b0388adca1f4c91918ce1175e8b360 (patch)
treec15f74eefd9c8477b7bf51b62068a0da90cae212 /super1.c
parentimsm: block changing slots during creation (diff)
downloadmdadm-70f1ff4291b0388adca1f4c91918ce1175e8b360.tar.xz
mdadm-70f1ff4291b0388adca1f4c91918ce1175e8b360.zip
mdadm: block update=ppl for non raid456 levels
Option ppl should be used only for raid levels 4, 5 and 6. Cancel update for other levels. Applied globally for imsm and ddf format. Additionally introduce is_level456() helper function. Signed-off-by: Lukasz Florczak <lukasz.florczak@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/super1.c b/super1.c
index 3a0c69fd..71af860c 100644
--- a/super1.c
+++ b/super1.c
@@ -1530,8 +1530,7 @@ static int update_super1(struct supertype *st, struct mdinfo *info,
* So we reject a revert-reshape unless the
* alignment is good.
*/
- if (__le32_to_cpu(sb->level) >= 4 &&
- __le32_to_cpu(sb->level) <= 6) {
+ if (is_level456(__le32_to_cpu(sb->level))) {
reshape_sectors =
__le64_to_cpu(sb->reshape_position);
reshape_chunk = __le32_to_cpu(sb->new_chunk);