Last LBA missed on NvmExpressMediaClear#12424
Last LBA missed on NvmExpressMediaClear#12424spbrogan wants to merge 1 commit intotianocore:masterfrom
Conversation
|
resolves #12396 |
mikebeaton
left a comment
There was a problem hiding this comment.
It is correct that LastBlock is (almost, see below) universally initialized to Size -1 (or copied from another last block value) in the codebase.
Could the comment be updated?
https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Protocol/BlockIo.h#L173-L177
e.g.
/// The last logical block address on the device (inclusive).
Additionally, Is this test wrong?
Off by one error in the code of NvmExpressMediaClear() causes the last LBA to be missed when clearing the media. This patch fixes the issue by adjusting the loop condition to ensure that all LBAs are cleared properly. Signed-off-by: Sean Brogan <sebrogan@microsoft.com>
This PR #12426 makes an update. I don't think it really mattered for the host-based unit test as the device was essentially mocked but I think it should be clear for intent. |
Thank you. It is true that the UEFI spec. for EFI_BLOCK_IO_MEDIA is also unambiguous. The comment for LastBlock in the header file is not, however. Could/should it be updated, e.g. to: |
Off by one error in the code of NvmExpressMediaClear() causes the last LBA to be missed when clearing the media. This patch fixes the issue by adjusting the loop condition to ensure that all LBAs are cleared properly.
How This Was Tested
Host based unit tests and code inspection
Integration Instructions
n/a