numam-spdk/lib
Shuhei Matsumoto 22adcd1487 lib/iscsi: Fix orphaned PDUs when freeing PDUs and tasks for LUN hotplug
In _iscsi_conn_free_tasks(), we had parsed conn->write_pdu_list
and then parsed conn->queued_datain_tasks.  However when we parsed
conn->write_pdu_list, if there was any task in conn->queued_datain_tasks,
some PDUs were inserted conn->write_pdu_list.  Hence after parsing
conn->write_pdu_list, new PDUs were in conn->write_pdu_list as orphan.
Then orphaned PDUs were freed later but LUN was already freed and
critical failure occurred.

This patch swaps the order of conn->queued_datain_tasks and
conn->write_pdu_list, and add comment to explain the change.

Additionally, this patch adds unit test which fails if it runs
without this fix.

Fixes issue #1030.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Icb0ffbbbac70792a62939dc55a69df05d2ab9128
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475453
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-12-05 12:21:09 +00:00
..
bdev bdev: remove _spdk_bdev function prefix 2019-11-20 09:34:18 +00:00
blob blob: fix sequentially allocated clusters starting from 0 2019-11-28 12:38:03 +00:00
blobfs blobfs: add result for set_cache_size 2019-11-07 00:33:25 +00:00
conf string: spdk_strtol to delegate additional error checking 2019-01-29 00:10:57 +00:00
copy lib/copy: move ioat subdir to module directory. 2019-08-22 16:29:49 +00:00
env_dpdk env: reuse set_translation code for clear_translation 2019-12-04 15:29:57 +00:00
env_ocf lib/bdev/ocf: update of ocf library to version 19.06 2019-10-22 17:22:41 +00:00
event app: Add cli options to print SPDK version 2019-11-15 18:25:31 +00:00
ftl lib/ftl: Keep state of single band relocation 2019-11-21 14:34:11 +00:00
ioat ioat: allocate device struct using regular calloc 2019-04-09 06:30:42 +00:00
iscsi lib/iscsi: Fix orphaned PDUs when freeing PDUs and tasks for LUN hotplug 2019-12-05 12:21:09 +00:00
json json_util: fix typo in debug message. 2019-05-31 14:39:53 +00:00
jsonrpc json: increase the json rpc client value limit 2019-11-18 13:16:49 +00:00
log lib/log: passing va_list to user-provided log call 2019-10-09 14:35:51 +00:00
log_rpc RPC: rename get_log_flags to log_get_flags 2019-09-24 16:42:41 +00:00
lvol lib/lvol: no longer store clear_method as an xattr 2019-11-28 12:37:46 +00:00
nbd rpc: Rename get_nbd_disks to nbd_get_disks 2019-09-19 20:56:35 +00:00
net log: remove old-style errlog entries. 2019-09-26 16:15:11 +00:00
notify RPC: rename get_notifications to notify_get_notifications 2019-09-24 16:42:41 +00:00
nvme lib/nvme: stop all NVMe io producers on detach 2019-11-28 12:36:58 +00:00
nvmf nvmf/tcp: rm qpair destroy from poll_group_add 2019-11-28 12:36:36 +00:00
reduce lib/reduce: enable deletion of a vol w/o a pmem file 2019-08-22 04:31:46 +00:00
rocksdb RocksDB: Remove static and assert for SpdkInitializeThread 2019-07-05 04:19:11 +00:00
rpc RPC: properly set the address in error cases 2019-12-04 15:11:55 +00:00
rte_vhost rte_vhost: unaffinitize the thread inside rte_vhost API function 2019-11-20 09:33:43 +00:00
scsi lib/scsi: Move scsi_task_free_data() in a file to remove function declaration 2019-11-21 08:01:29 +00:00
sock sock: Simply spdk_sock_close 2019-11-22 13:54:58 +00:00
thread thread: fix set-but-unused warning 2019-11-08 00:07:51 +00:00
trace trace: fix calculation of histories_size 2019-11-06 15:19:48 +00:00
ut_mock test: Add mocks for sendmsg and recvmsg 2019-11-01 17:56:16 +00:00
util util: Add spdk_iovcpy, an iovec to iovec copy function. 2019-11-20 09:35:32 +00:00
vhost vhost: wrap some of rte_vhost functions 2019-11-20 09:33:43 +00:00
virtio lib/virtio: change the definition of cookie 2019-06-26 08:03:37 +00:00
vmd vmd: fix the memory leak issue if vmd address cannot assigned. 2019-11-06 14:49:21 +00:00
Makefile make: add dependencies for the rte_vhost build. 2019-09-09 22:15:24 +00:00