linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Ni <xni@redhat.com>
To: mariusz.tkaczyk@linux.intel.com
Cc: linux-raid@vger.kernel.org, ncroxon@redhat.com
Subject: [PATCH 2/2] mdadm/Grow: Check new_level interface rather than kernel version
Date: Fri, 18 Oct 2024 16:48:17 +0800	[thread overview]
Message-ID: <20241018084817.60233-3-xni@redhat.com> (raw)
In-Reply-To: <20241018084817.60233-1-xni@redhat.com>

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 --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;
 
-- 
2.32.0 (Apple Git-132)


  parent reply	other threads:[~2024-10-18  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  8:48 [PATCH 0/2] mdadm: minor fixes Xiao Ni
2024-10-18  8:48 ` [PATCH V2 1/2] mdadm/Manage: Clear superblock if adding new device fails Xiao Ni
2024-10-18  8:48 ` Xiao Ni [this message]
2024-10-18 12:51 ` [PATCH 0/2] mdadm: minor fixes Mariusz Tkaczyk
  -- strict thread matches above, loose matches on Subject: below --
2024-10-18  8:22 Xiao Ni
2024-10-18  8:22 ` [PATCH 2/2] mdadm/Grow: Check new_level interface rather than kernel version Xiao Ni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241018084817.60233-3-xni@redhat.com \
    --to=xni@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.com \
    --cc=ncroxon@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).