]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm/super1: Add MD_FEATURE_RAID0_LAYOUT if kernel>=5.4
authorXiao Ni <xni@redhat.com>
Tue, 17 Oct 2023 12:35:46 +0000 (20:35 +0800)
committerJes Sorensen <jes@trained-monkey.org>
Thu, 26 Oct 2023 21:48:50 +0000 (17:48 -0400)
commit6af520a5b4d91cd0fd32ab6361ff4519505c7f47
treedc0acbfb1f79c949948d317626046a363fe24416
parent246b4b40558f6f7f84882e9c34659f1b582944e2
mdadm/super1: Add MD_FEATURE_RAID0_LAYOUT if kernel>=5.4

After and include kernel v5.4, it adds one feature bit MD_FEATURE_RAID0_LAYOUT.
It must need to specify a layout for raid0 with more than one zone. But for
raid0 with one zone, in fact it also has a defalut layout.

Now for raid0 with one zone, *unknown* layout can be seen when running mdadm -D
command. It's the reason that mdadm doesn't set MD_FEATURE_RAID0_LAYOUT for
raid0 with one zone. Then in kernel space, super_1_validate sets mddev->layout
to -1 because of no MD_FEATURE_RAID0_LAYOUT. In fact, in raid0 io path, it
uses the default layout. Set raid0_need_layout to true if kernel_version<=v5.4.

Fixes: 329dfc28debb ('Create: add support for RAID0 layouts.')
Signed-off-by: Xiao Ni <xni@redhat.com>
Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
super1.c