Spdk/test/unit/lib/blob
Jim Harris 037c8b01a1 blob: remove short-circuiting path for blob_freeze
If blob_freeze_io() is called twice in a row,
and the second time occurs before the for_each_channel
for the first completes, the second caller will
receive its callback too soon.

Instead just simplify the whole process, always do
the for_each_channel and don't try to optimize it
at all.  These are infrequent operations - correctness
and simplicity are in order.

A few additional changes:

1) Make same changes for unfreeze path.
2) Add blob_verify_md_op() calls, just to be sure
   these are only called from md_thread.  This was
   already checked in calling functions, but as these
   functions get called from new code paths (i.e.
   esnap clones) it can't hurt to add additional
   checks.
3) Add unit test that failed with original code, but
   passes with this patch.

Fixes issue #2935.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibefba554547ddf3e26aaabfa4288c8073d3c04ff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17148
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Mike Gerdts <mgerdts@nvidia.com>
Community-CI: Mellanox Build Bot
2023-03-15 09:27:17 +00:00
..
blob_bdev.c blob_bdev: take read-only-many claims on ro devs 2023-03-03 11:25:35 +00:00
blob.c blob: remove short-circuiting path for blob_freeze 2023-03-15 09:27:17 +00:00
bs_dev_common.c test/blob: test with and without copy offload 2023-03-03 11:25:35 +00:00
bs_scheduler.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
Makefile test/blob: create unit test for blob_bdev 2023-02-09 11:20:34 +00:00