blob: add assert that cluster_sz > 0
Avoids divide-by-zero scanbuild warning on Fedora36. Fixes issue #2667. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ib2793c793725e8bb8ba25fb779ffc14334929da0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14238 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Dong Yi <dongx.yi@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
parent
475b86aa8d
commit
ffa823557a
@ -495,6 +495,8 @@ bs_page_to_cluster(struct spdk_blob_store *bs, uint64_t page)
|
||||
static inline uint64_t
|
||||
bs_cluster_to_lba(struct spdk_blob_store *bs, uint32_t cluster)
|
||||
{
|
||||
assert(bs->cluster_sz / bs->dev->blocklen > 0);
|
||||
|
||||
return (uint64_t)cluster * (bs->cluster_sz / bs->dev->blocklen);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user