Linux block layer
 help / color / mirror / Atom feed
From: Sebastian Chlad <sebastianchlad@gmail.com>
To: linux-block@vger.kernel.org
Cc: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	Sebastian Chlad <sebastian.chlad@suse.com>
Subject: [PATCH 1/2] common/rc: add _have_debugfs()
Date: Thu, 16 Jul 2026 11:06:25 +0200	[thread overview]
Message-ID: <20260716090626.27558-1-sebastian.chlad@suse.com> (raw)

Kernel options like FAULT_INJECTION_DEBUG_FS being enabled does not
guarantee debugfs is actually mounted at /sys/kernel/debug: on
systemd systems, sys-kernel-debug.mount may not be started by
default (e.g. SLE).

Add _have_debugfs(), mirroring the existing _have_configfs() and
_have_tracefs() checks, so tests that depend on debugfs-backed
interfaces can skip cleanly with a clear reason instead of failing.
---
 common/rc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/rc b/common/rc
index d60a125..de5eb6d 100644
--- a/common/rc
+++ b/common/rc
@@ -223,6 +223,14 @@ _have_configfs() {
 	return 0
 }
 
+_have_debugfs() {
+	if ! findmnt -t debugfs /sys/kernel/debug >/dev/null; then
+		SKIP_REASONS+=("debugfs is not mounted at /sys/kernel/debug")
+		return 1
+	fi
+	return 0
+}
+
 # Check if the specified kernel config files are available.
 _have_kernel_config_file() {
 	if [[ ! -f /proc/config.gz && ! -f /boot/config-$(uname -r) ]]; then
-- 
2.51.0


             reply	other threads:[~2026-07-16  9:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  9:06 Sebastian Chlad [this message]
2026-07-16  9:06 ` [PATCH 2/2] nvme/039: skip cleanly when debugfs is not mounted Sebastian Chlad
2026-07-16 10:05 ` [PATCH 1/2] common/rc: add _have_debugfs() Daniel Wagner

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=20260716090626.27558-1-sebastian.chlad@suse.com \
    --to=sebastianchlad@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=sebastian.chlad@suse.com \
    --cc=shinichiro.kawasaki@wdc.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