Spdk/test/unit/lib
Mike Gerdts cc27c1ab11 blobstore: missing lock leads to md page race
Many parts of the blobstore.c seem to have gone with the assumption that
blob creation, deletion, etc. all happen on the md thread. This
assumption would allow modification of the bs->used_md_pages and
bs->used_clusters bit arrays without holding a lock. Placing
"assert(spdk_get_thread() == bs->md_thread)" in bs_claim_md_page() and
bs_claim_cluster() show that each of these functions are called on other
threads due writes to thin provisioned volumes.

This problem was first seen in the wild with this failed assertion:

  bs_claim_md_page: Assertion
     `spdk_bit_array_get(bs->used_md_pages, page) == false' failed.

This commit adds "assert(spdk_spin_held(&bs->used_lock))" in those
places where bs->used_md_pages and bs->used_lock are modified, then
holds bs->used_lock in the places needed to satisfy these assertions.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I0523dd343ec490d994352932b2a73379a80e36f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15953
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:19:09 +00:00
..
accel update Intel copyright notices 2022-11-10 08:28:53 +00:00
bdev bdev/crypto: do not create mempool for session private data 2022-12-19 08:35:14 +00:00
blob blobstore: missing lock leads to md page race 2022-12-20 09:19:09 +00:00
blobfs update Intel copyright notices 2022-11-10 08:28:53 +00:00
dma Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
env_dpdk update Intel copyright notices 2022-11-10 08:28:53 +00:00
event test/unit: call spdk_thread_exit() in reactor_ut 2022-11-23 08:22:04 +00:00
ftl update Intel copyright notices 2022-11-10 08:28:53 +00:00
idxd update Intel copyright notices 2022-11-10 08:28:53 +00:00
init subsystem: assert all subsystems initialized on app thread 2022-11-23 08:22:04 +00:00
ioat update Intel copyright notices 2022-11-10 08:28:53 +00:00
iscsi iscsi: fix segfault when r2t 2022-11-29 17:21:18 +00:00
json json: add spdk_json_write_named_double 2022-11-22 10:01:43 +00:00
jsonrpc update Intel copyright notices 2022-11-10 08:28:53 +00:00
log log: add deprecated tracking API 2022-12-07 17:45:53 +00:00
lvol update Intel copyright notices 2022-11-10 08:28:53 +00:00
notify update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvme nvme_rdma: Rename poll_group_set_cq() by qpair_set_poller() 2022-12-08 12:54:40 +00:00
nvmf misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
rdma rdma: Maintain per device PD which is persistent across reconnect 2022-08-12 08:59:43 +00:00
reduce test/reduce: fix missing mem free call and add test call to UT script 2022-12-08 12:55:27 +00:00
rpc update Intel copyright notices 2022-11-10 08:28:53 +00:00
scsi update Intel copyright notices 2022-11-10 08:28:53 +00:00
sock misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
thread thread: cache a number of iobuf buffers on each channel 2022-12-16 09:06:07 +00:00
util misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
vhost misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
json_mock.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
Makefile configure: rename --with-reduce --with-vbdev-compress 2022-12-08 12:55:27 +00:00