Spdk/lib/blob
Tomasz Zawadzki 3eb03cc7b6 blobstore: workaround for bs_cluster_to_lba() scan-build false positive
Patch https://review.spdk.io/gerrit/c/spdk/spdk/+/16328,
introduced a refactor for persist path. No functional change
should occur with it, but the code layout after compilation
(path length) might have changed.

It resulted in unrelated scan-build failure:
https://ci.spdk.io/results/autotest-per-patch/builds/95746/archive/scanbuild-vg-autotest/scan-build/report-d08e76.html#EndPath

Tried to replicate the issue without the above patch,
by increasing maxloop or -analyze-headers in scan-build.
Didn't result in any new failures in blobstore.

This seemed like a false positive, so it was verified:
https://review.spdk.io/gerrit/c/spdk/spdk/+/16333/

With no other options, an assert is added only to the
function where the false positive occured.

scan-build log for posterity:
blobstore.c:1062:58: warning: Division by zero [core.DivideZero]
                desc_extent_rle->extents[extent_idx].cluster_idx = lba /
lba_per_cluster;
                                                                   ~~~~^~~~~~~~~~~~~~~~~
blobstore.c:1079:58: warning: Division by zero [core.DivideZero]
                desc_extent_rle->extents[extent_idx].cluster_idx = lba /
lba_per_cluster;
                                                                   ~~~~^~~~~~~~~~~~~~~~~

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9dd729fa13ce1c9bbcb91e4326658e2b4e326e6d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16335
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-01-20 17:56:56 +00:00
..
blob_bs_dev.c blob: Add translate_lba operation 2022-12-08 12:54:54 +00:00
blobstore.c blobstore: workaround for bs_cluster_to_lba() scan-build false positive 2023-01-20 17:56:56 +00:00
blobstore.h blobstore: convert used_lock to spinlock 2022-12-20 09:19:09 +00:00
Makefile blob: Add translate_lba operation 2022-12-08 12:54:54 +00:00
request.c blob: Use bdev copy command in CoW flow if supported 2022-12-08 12:54:54 +00:00
request.h blob: Use bdev copy command in CoW flow if supported 2022-12-08 12:54:54 +00:00
spdk_blob.map blob: Add functions to find [un]allocated io_unit 2022-09-15 08:23:56 +00:00
zeroes.c blob: Add translate_lba operation 2022-12-08 12:54:54 +00:00