lib/blob: fix check against lba during blob load
md_start and md_len are values in pages rather than lba. Those should not be compared against lba of currently loaded md page. This patch changes assert to verify if the lba of current page does not exceed max lba where md is expected to be. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: Id445eb9871f82f7fe367bfc396f1b495591511c1 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460976 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
parent
6ced601526
commit
672d42b284
@ -975,9 +975,9 @@ _spdk_blob_load_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
|
||||
if (page->next != SPDK_INVALID_MD_PAGE) {
|
||||
uint32_t next_page = page->next;
|
||||
uint64_t next_lba = _spdk_bs_page_to_lba(blob->bs, blob->bs->md_start + next_page);
|
||||
uint64_t max_md_lba = _spdk_bs_page_to_lba(blob->bs, blob->bs->md_start + blob->bs->md_len);
|
||||
|
||||
|
||||
assert(next_lba < (blob->bs->md_start + blob->bs->md_len));
|
||||
assert(next_lba < max_md_lba);
|
||||
|
||||
/* Read the next page */
|
||||
ctx->num_pages++;
|
||||
|
Loading…
Reference in New Issue
Block a user