Spdk/include
Mike Gerdts 7241a075be bdev: hold spinlock while changing claim_module
This closes races between concurrent spdk_bdev_module_claim_bdev()
and/or spdk_bdev_module_release_bdev() calls affecting the same bdev by
holding bdev->internal.spinlock while claiming and releasing a bdev. It
also closes a potential TOCTOU bug in that optimizing compilers probably
already eliminate in bdev_finish_unregister_bdevs_iter() and documents
that bdev->internal.claim_module is protected by
bdev->internal.spinlock.

This can be removed when the bdev_register_examine_thread deprecation
is removed.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ib48552df065d5172139a61bbc00b391f36552c0c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15282
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2023-01-05 23:28:32 +00:00
..
linux check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
spdk bdev: hold spinlock while changing claim_module 2023-01-05 23:28:32 +00:00
spdk_internal misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
Makefile update Intel copyright notices 2022-11-10 08:28:53 +00:00