summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiao Ni <xni@redhat.com>2024-10-18 10:48:17 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-10-18 14:50:09 +0200
commitb278b2fc172bb8d50f607adef4d515af1f52d913 (patch)
tree83e4ca42a58695707fe726cc3cb6ee5945ee1c6f
parentmdadm/Manage: Clear superblock if adding new device fails (diff)
downloadmdadm-b278b2fc172bb8d50f607adef4d515af1f52d913.tar.xz
mdadm-b278b2fc172bb8d50f607adef4d515af1f52d913.zip
mdadm/Grow: Check new_level interface rather than kernel version
Different os distributions have different kernel version themselves. Check new_level sysfs interface rather than kernel version. Signed-off-by: Xiao Ni <xni@redhat.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
-rw-r--r--Grow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grow.c b/Grow.c
index ef1285ec..9032c3e9 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2952,7 +2952,7 @@ static int impose_reshape(struct mdinfo *sra,
err = errno;
/* new_level is introduced in kernel 6.12 */
- if (!err && get_linux_version() >= 6012000 &&
+ if (!err && sysfs_attribute_available(sra, NULL, "new_level") &&
sysfs_set_num(sra, NULL, "new_level", info->new_level) < 0)
err = errno;