Skip to content

tree: gracefully handle empty dirs#3156

Merged
igaw merged 1 commit intolinux-nvme:masterfrom
igaw:fix-nvme-scan
Mar 10, 2026
Merged

tree: gracefully handle empty dirs#3156
igaw merged 1 commit intolinux-nvme:masterfrom
igaw:fix-nvme-scan

Conversation

@igaw
Copy link
Copy Markdown
Collaborator

@igaw igaw commented Mar 10, 2026

When no devices are present, /sys/class/nvme and
/sys/class/nvme-subsystem directories may not exist. scandir returns -1 with errno set to ENOENT.

nvme_scan treats this as a fatal error instead it should just ignore it. There is just nothing to scan.

This fixes the python-create-ctrl-object and python-sigsegv-during-gc tests that fail when no NVMe devices are present in the test environment.

Fixes: #3150

When no devices are present, /sys/class/nvme and
/sys/class/nvme-subsystem directories may not exist. scandir returns
-1 with errno set to ENOENT.

nvme_scan treats this as a fatal error instead it should just ignore it.
There is just nothing to scan.

This fixes the python-create-ctrl-object and python-sigsegv-during-gc tests
that fail when no NVMe devices are present in the test environment.

Signed-off-by: Daniel Wagner <[email protected]>
@igaw igaw merged commit cf0fe4d into linux-nvme:master Mar 10, 2026
26 checks passed
@igaw igaw deleted the fix-nvme-scan branch March 10, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python binding: 'global_ctx_log_level', argument 1 of type 'struct nvme_global_ctx *'

1 participant