Skip to content

nvme-print-json: list only the supported events of the persistent event log - #4229

Merged
igaw merged 1 commit into
linux-nvme:masterfrom
dwsuse:fix-pel-json-bitmap
Oct 20, 2026
Merged

igaw merged 1 commit into
linux-nvme:masterfrom
dwsuse:fix-pel-json-bitmap

Conversation

@dwsuse

@dwsuse dwsuse commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

json_add_bitmap() added a key for every event of a non-zero byte of the Supported Events Bitmap of the persistent event log, but filled in its value only for the supported events. The other keys got the uninitialized stack buffer evt_str, so nvme log persistent-event -o json printed random bytes, different on every run.

List the supported events only, as the normal output does.

Found by comparing the output of the print test with and without the decoder sandbox (#4183): the random bytes differed between the two runs. #4183 carries the same commit, as its comparison test depends on it.

Testing:

  • new print test: only the supported event is listed, in the normal and the JSON output; fails without the change (the old code lists bitmap_0, bitmap_1, ... with uninitialized values)
  • full test suite

…nt log

json_add_bitmap() added a key for every event of a non-zero byte of the
Supported Events Bitmap, but filled in its value only for the supported
ones. The other keys got the uninitialized stack buffer, so
"nvme log persistent-event -o json" printed random bytes.

List the supported events only, as the normal output does.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
@igaw
igaw merged commit a64b574 into linux-nvme:master Oct 20, 2026
34 checks passed
@dwsuse
dwsuse deleted the fix-pel-json-bitmap branch October 23, 2026 10:23
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