Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

md: add check_new_feature module parameter

Raid checks if pad3 is zero when loading superblock from disk. Arrays
created with new features may fail to assemble on old kernels as pad3
is used.

Add module parameter check_new_feature to bypass this check.

Link: https://lore.kernel.org/linux-raid/20251103125757.1405796-5-linan666@huaweicloud.com
Signed-off-by: Li Nan <linan122@huawei.com>
Reviewed-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Yu Kuai <yukuai@fnnas.com>

authored by

Li Nan and committed by
Yu Kuai
9c47127a 2107457e

+9 -3
+9 -3
drivers/md/md.c
··· 339 339 */ 340 340 static bool create_on_open = true; 341 341 static bool legacy_async_del_gendisk = true; 342 + static bool check_new_feature = true; 342 343 343 344 /* 344 345 * We have a system wide 'event count' that is incremented ··· 1852 1851 } 1853 1852 if (sb->pad0 || 1854 1853 sb->pad3[0] || 1855 - memcmp(sb->pad3, sb->pad3+1, sizeof(sb->pad3) - sizeof(sb->pad3[1]))) 1856 - /* Some padding is non-zero, might be a new feature */ 1857 - return -EINVAL; 1854 + memcmp(sb->pad3, sb->pad3+1, sizeof(sb->pad3) - sizeof(sb->pad3[1]))) { 1855 + pr_warn("Some padding is non-zero on %pg, might be a new feature\n", 1856 + rdev->bdev); 1857 + if (check_new_feature) 1858 + return -EINVAL; 1859 + pr_warn("check_new_feature is disabled, data corruption possible\n"); 1860 + } 1858 1861 1859 1862 rdev->preferred_minor = 0xffff; 1860 1863 rdev->data_offset = le64_to_cpu(sb->data_offset); ··· 10746 10741 module_param_call(new_array, add_named_array, NULL, NULL, S_IWUSR); 10747 10742 module_param(create_on_open, bool, S_IRUSR|S_IWUSR); 10748 10743 module_param(legacy_async_del_gendisk, bool, 0600); 10744 + module_param(check_new_feature, bool, 0600); 10749 10745 10750 10746 MODULE_LICENSE("GPL"); 10751 10747 MODULE_DESCRIPTION("MD RAID framework");