diff mbox series

[2/2] mdadm/Grow: Check new_level interface rather than kernel version

Message ID 20241018082203.59963-3-xni@redhat.com (mailing list archive)
State Superseded
Headers show
Series mdadm: minor fixes | expand

Checks

Context Check Description
mdraidci/vmtest-md-6_13-PR fail merge-conflict

Commit Message

Xiao Ni Oct. 18, 2024, 8:22 a.m. UTC
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>
---
 Grow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/Grow.c b/Grow.c
index ef1285ecebcf..9032c3e9c09f 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;