numam-spdk/lib
Dariusz Stojaczyk 32f86a5f34 bdev: don't call recursively desc->remove_cb on bdev removal
When device has more than one open descriptor, remove_cbs of particular
descriptors could be called more than once.

Consider the following scenario:
bdev X with 2 open descriptors A and B.
X is removed (hotremoved for instance)
bdev_unregister(X) is called
  * bdev->status = REMOVING
  * A->remove_cb is called
    * some poller is started
  * B->remove_cb is called
    * another poller started

* poller from A->remove_cb finishes it's work and closes the desc:
  * bdev_close(A)
    * A is removed from bdev->open_descs list
    * bdev->status is REMOVING, so bdev_unregister(X) is called again!
      * B->remove cb is called again!
        * another poller starts? segfault?

Fixes: 57d174ff67 ("bdev: add spdk_bdev_open/close")

Change-Id: I0a898ec0aee521d0b2a1168fe7d469cc41a8ef4f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/369727
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-17 19:06:42 -04:00
..
bdev bdev: don't call recursively desc->remove_cb on bdev removal 2017-07-17 19:06:42 -04:00
blob bdev: pass descriptors for I/O operations 2017-07-14 13:31:30 -04:00
blobfs blobfs: Handle request alloc failure during init/load 2017-07-17 18:56:37 -04:00
conf log: Use SPDK_ERRLOG in lieu of fprintf(stderr 2017-05-09 11:28:28 -07:00
copy copy: Move asynchronous module init to event_copy 2017-06-20 13:46:37 -04:00
cunit include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
env_dpdk env_dpdk: allow spdk_mem_map_free() map to be NULL 2017-06-30 13:53:30 -04:00
event jsonrpc: modify API to pass request to handler 2017-07-06 13:48:12 -04:00
ioat env: Rename spdk_malloc/zmalloc/realloc/free to spdk_dma_(func) 2017-05-31 15:30:27 -04:00
iscsi iscsi: refactor and simplify digest calculations 2017-07-17 14:18:07 -04:00
json json: add function to write UTF-16LE strings 2017-07-12 18:12:52 -04:00
jsonrpc jsonrpc: remove incorrect handling for send() == 0 2017-07-13 15:47:56 -04:00
log jsonrpc: modify API to pass request to handler 2017-07-06 13:48:12 -04:00
net jsonrpc: modify API to pass request to handler 2017-07-06 13:48:12 -04:00
nvme nvme/rdma: print getaddrinfo() error if it fails 2017-07-17 17:58:55 -04:00
nvmf bdev: pass descriptors for I/O operations 2017-07-14 13:31:30 -04:00
rocksdb rocksdb: set errno to support Myrocks engine 2017-07-13 15:43:55 -04:00
rpc jsonrpc: modify API to pass request to handler 2017-07-06 13:48:12 -04:00
scsi bdev: pass descriptors for I/O operations 2017-07-14 13:31:30 -04:00
trace include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
ut_mock tests: macro-ize the creation and use of wrappers and stubs 2017-07-05 12:00:34 -04:00
util util: call for_each_channel completion in original thread 2017-07-17 15:20:10 -04:00
vhost vhost: Make JSON-RPC parameter names as consistent as possible 2017-07-14 15:54:28 -04:00
Makefile test: add wrap capability 2017-06-08 19:24:54 -04:00