Skip to content

micron: fix vs-internal-log file size mismatches vs log headers and missing telemetry host log - #3831

Merged
igaw merged 2 commits into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/micron-internal-logs-fixes
Aug 13, 2026
Merged

micron: fix vs-internal-log file size mismatches vs log headers and missing telemetry host log#3831
igaw merged 2 commits into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/micron-internal-logs-fixes

Conversation

@brgoing

@brgoing brgoing commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Cleans up a few minor log issues impacting the output of micron vs-internal-log.

  • Fixes a possible telemetry log size mismatch when comparing the log header within the saved file to the actual file size. Since the log header was being read twice - once to determine size and again as part of the entire log pull, the size on the second read could be mismatched to the size actually read if new log entries had been made. No longer reads the header twice.
  • Ensures that the host telemetry log gets created when reading the logs.
  • Fixes log size calculation for common logs that was including the log header size twice.

* Fixes possible telemetry log mismatch between the file size and the
size reported in the header contained in the file.  Keeps the header
data from the initial read, which is used to determine the log size,
rather than re-reading it.  Adds test to avoid regressions.
* Requests host telemetry log creation to ensure the host log exists
when reading.

Signed-off-by: Broc Going <bgoing@micron.com>
For some logs, the buffer/file size calculation double counted the
header, which caused the file size to be larger than the log size
indicated in the header, with zero-padded values after the end of the
log.  This change accounts for the header size correctly in these cases.

Signed-off-by: Broc Going <bgoing@micron.com>
/* log_size includes the header, so the payload is the remainder */
uint32_t payload = hdr.log_size - sizeof(hdr);

buffer = (uint8_t *)libnvme_alloc(hdr.log_size);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, libnvme_alloc returns void *, thus there is no explicit cast necessary. IMO, it reads simpler without the cast.

@igaw
igaw merged commit 5271f89 into linux-nvme:master Aug 13, 2026
32 of 33 checks passed
@igaw

igaw commented Aug 13, 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