diff options
author | NeilBrown <neilb@suse.de> | 2019-11-04 04:27:49 +0100 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2019-12-02 22:15:56 +0100 |
commit | 027c099fd1a31fb3815e592de75d0791a22353b4 (patch) | |
tree | cc39fb437892f8d1e0a88415552976a4871fae3f /super1.c | |
parent | Create: add support for RAID0 layouts. (diff) | |
download | mdadm-027c099fd1a31fb3815e592de75d0791a22353b4.tar.xz mdadm-027c099fd1a31fb3815e592de75d0791a22353b4.zip |
Assemble: add support for RAID0 layouts.
If you have a RAID0 array with varying sized devices
on a kernel before 5.4, you cannot assembling it on
5.4 or later without explicitly setting the layout.
This is now possible with
--update=layout-original (For 3.13 and earlier kernels)
or
--update=layout-alternate (for 3.14 and later kernels)
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'super1.c')
-rw-r--r-- | super1.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1550,7 +1550,17 @@ static int update_super1(struct supertype *st, struct mdinfo *info, sb->devflags |= FailFast1; else if (strcmp(update, "nofailfast") == 0) sb->devflags &= ~FailFast1; - else + else if (strcmp(update, "layout-original") == 0 || + strcmp(update, "layout-alternate") == 0) { + if (__le32_to_cpu(sb->level) != 0) { + pr_err("%s: %s only supported for RAID0\n", + devname?:"", update); + rv = -1; + } else { + sb->feature_map |= __cpu_to_le32(MD_FEATURE_RAID0_LAYOUT); + sb->layout = __cpu_to_le32(update[7] == 'o' ? 1 : 2); + } + } else rv = -1; sb->sb_csum = calc_sb_1_csum(sb); |