Skip to content

Commit

Permalink
fix: handle lba range validity on ancestors with smaller sizes
Browse files Browse the repository at this point in the history
Do valid cluster range while handling SPDK_NVME_IO_FLAGS_UNWRITTEN_READ_FAIL

Signed-off-by: Diwakar Sharma <[email protected]>
  • Loading branch information
dsharma-dc authored and dsavitskiy committed May 10, 2024
1 parent 4ffc9d2 commit 64c3efb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/blob/blobstore.c
Original file line number Diff line number Diff line change
Expand Up @@ -2798,6 +2798,14 @@ blob_ancestor_calc_lba_and_lba_count(struct spdk_blob *blob, uint64_t io_unit, u
}
*lba_count = length;
while (blob->parent_id != SPDK_BLOBID_INVALID) {
uint32_t cluster_start_page = bs_io_unit_to_cluster_start(blob, io_unit);
bool is_valid_range = blob->back_bs_dev->is_range_valid(blob->back_bs_dev,
bs_dev_page_to_lba(blob->back_bs_dev, cluster_start_page),
bs_dev_byte_to_lba(blob->back_bs_dev, blob->bs->cluster_sz));
if (!is_valid_range) {
goto error;
}

spdk_blob_id blob_id = blob->parent_id;
blob = blob_lookup(blob->bs, blob_id);
if (blob == NULL) {
Expand Down

0 comments on commit 64c3efb

Please sign in to comment.