Skip to content

libnvme: drop the static stat buffer in nvme_verify_chr() - #3917

Merged
igaw merged 1 commit into
linux-nvme:masterfrom
prabhakarpujeri:fix-verify-chr-static
Aug 26, 2026
Merged

libnvme: drop the static stat buffer in nvme_verify_chr()#3917
igaw merged 1 commit into
linux-nvme:masterfrom
prabhakarpujeri:fix-verify-chr-static

Conversation

@prabhakarpujeri

Copy link
Copy Markdown

Problem

nvme_verify_chr() uses a static struct stat as the fstat() target, shared across all threads — concurrent resets / rescans on different transport handles race writing into it and can observe a torn st_mode. (The companion 1.x issue of returning a positive errno, linux-nvme/libnvme#1130, is already correct in this tree — it returns -errno.)

Fix

Make the buffer automatic; nothing in the function is meant to be shared or retained.

Testing

  • Full meson suite green. Single-keyword change; no behavioral difference for single-threaded consumers.

The fstat() target is a static struct stat shared across all
threads, so concurrent reset/ns-rescan calls on different handles
race writing into it and can observe a torn st_mode.  There is no
shared state worth keeping.

Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
@igaw

igaw commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

dropped the libnvme 1 reference.

@igaw
igaw force-pushed the fix-verify-chr-static branch from c0ef703 to 5699b68 Compare August 26, 2026 14:06
@igaw
igaw merged commit d115728 into linux-nvme:master Aug 26, 2026
30 checks passed
@igaw

igaw commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

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.

2 participants