Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correct smartctl_device_bytes_written & smartctl_device_bytes_re…
…ad for NVMe (#211) The NVMe specification says that the controller is responsible for reporting "Data Units Read" & "Data Units Written" converted as needed for logicial block sizes other than 512-bytes. smartmontools already has the correct behavior. What is correct in this case? For now, track what smartmontools does: take the counter, multiply by 512*1000, report the value. We should be clear that it means the drive has read/written at most that many bytes. This has a few impacts: - NVME devices will now show these metrics, if they did not before. - NVME devices with blocksize other than 512-bytes may have previously reported inflated metrics, but are now corrected (is this worthy of larger notice in changelogs?) Reference: https://github.com/smartmontools/smartmontools/blob/11415ee0b9d5f4a22ddfb3722fdfb05e72372a03/smartmontools/nvmeprint.cpp#L394-L397 Closes: #122 Signed-off-by: Robin H. Johnson <[email protected]>
- Loading branch information