All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vishal Verma <vishal.l.verma@intel.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH] ndctl, test: make btt-pad-compat dynamically detect a patched kernel
Date: Fri,  2 Feb 2018 15:36:59 -0700	[thread overview]
Message-ID: <20180202223659.28413-1-vishal.l.verma@intel.com> (raw)

The btt-pad-compat test can detect whether it is running on a patched
kernel by checking for the two newly added debugfs files in the fix for
this bug. Use that instead of hard coding a kernel version dependency.

Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 test/btt-pad-compat.sh | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/test/btt-pad-compat.sh b/test/btt-pad-compat.sh
index d10efe3..faa773c 100755
--- a/test/btt-pad-compat.sh
+++ b/test/btt-pad-compat.sh
@@ -41,17 +41,6 @@ err()
 	exit "$rc"
 }
 
-check_min_kver()
-{
-	local ver="$1"
-	: "${KVER:=$(uname -r)}"
-
-	[ -n "$ver" ] || return 1
-	[[ "$ver" == "$(echo -e "$ver\n$KVER" | sort -V | head -1)" ]]
-}
-
-check_min_kver "4.15" || { echo "kernel $KVER may not have btt padding compat fixes"; exit "$rc"; }
-
 check_prereq()
 {
 	if ! command -v "$1" >/dev/null; then
@@ -70,6 +59,10 @@ create()
 	[ $size -gt 0 ] || err "$LINENO" 2
 	bttdev=$(cat /sys/bus/nd/devices/$dev/holder)
 	[ -n "$bttdev" ] || err "$LINENO" 2
+	if [ ! -e /sys/kernel/debug/btt/$bttdev/arena0/log_index_0 ]; then
+		echo "kernel $(uname -r) seems to be missing the BTT compatibility fixes, skipping"
+		exit 77
+	fi
 }
 
 reset()
-- 
2.14.3

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

             reply	other threads:[~2018-02-02 22:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 22:36 Vishal Verma [this message]
2018-02-02 22:39 ` [ndctl PATCH] ndctl, test: make btt-pad-compat dynamically detect a patched kernel Dan Williams

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=20180202223659.28413-1-vishal.l.verma@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.