Linux block layer
 help / color / mirror / Atom feed
* [PATCH v2 blktests 1/2] common/rc: add _have_debugfs()
@ 2026-07-16 10:08 Sebastian Chlad
  2026-07-16 10:08 ` [PATCH blktests v2 2/2] nvme/039: skip cleanly when debugfs is not mounted Sebastian Chlad
  2026-07-23 13:02 ` [PATCH v2 blktests 1/2] common/rc: add _have_debugfs() Shin'ichiro Kawasaki
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Chlad @ 2026-07-16 10:08 UTC (permalink / raw)
  To: linux-block; +Cc: Shin'ichiro Kawasaki, Sebastian Chlad

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.

Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH blktests v2 2/2] nvme/039: skip cleanly when debugfs is not mounted
  2026-07-16 10:08 [PATCH v2 blktests 1/2] common/rc: add _have_debugfs() Sebastian Chlad
@ 2026-07-16 10:08 ` Sebastian Chlad
  2026-07-23 13:02 ` [PATCH v2 blktests 1/2] common/rc: add _have_debugfs() Shin'ichiro Kawasaki
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Chlad @ 2026-07-16 10:08 UTC (permalink / raw)
  To: linux-block; +Cc: Shin'ichiro Kawasaki, Sebastian Chlad

_nvme_err_inject_setup() reads/writes files under
/sys/kernel/debug/<dev>/fault_inject/, which don't exist if debugfs
isn't mounted even though FAULT_INJECTION_DEBUG_FS is enabled in the
kernel config (e.g. SLE, where sys-kernel-debug.mount isn't started
by default).

Call _have_debugfs() from requires() to skip cleanly instead.

Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>
---
 tests/nvme/039 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/nvme/039 b/tests/nvme/039
index 8c70c5c..b634008 100755
--- a/tests/nvme/039
+++ b/tests/nvme/039
@@ -15,6 +15,7 @@ QUICK=1
 requires() {
 	_have_program nvme
 	_have_kernel_options FAULT_INJECTION FAULT_INJECTION_DEBUG_FS
+	_have_debugfs
 }
 
 device_requires() {
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 blktests 1/2] common/rc: add _have_debugfs()
  2026-07-16 10:08 [PATCH v2 blktests 1/2] common/rc: add _have_debugfs() Sebastian Chlad
  2026-07-16 10:08 ` [PATCH blktests v2 2/2] nvme/039: skip cleanly when debugfs is not mounted Sebastian Chlad
@ 2026-07-23 13:02 ` Shin'ichiro Kawasaki
  1 sibling, 0 replies; 3+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-07-23 13:02 UTC (permalink / raw)
  To: Sebastian Chlad; +Cc: linux-block, Sebastian Chlad

On Jul 16, 2026 / 12:08, Sebastian Chlad wrote:
> 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.
> 
> Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>

Thanks for the fix! I applied this series. Of note is that I added one more
commit for nvme/050 that has the same problem as nvme/039.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-23 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 10:08 [PATCH v2 blktests 1/2] common/rc: add _have_debugfs() Sebastian Chlad
2026-07-16 10:08 ` [PATCH blktests v2 2/2] nvme/039: skip cleanly when debugfs is not mounted Sebastian Chlad
2026-07-23 13:02 ` [PATCH v2 blktests 1/2] common/rc: add _have_debugfs() Shin'ichiro Kawasaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox