numam-spdk/module/bdev
GangCao 6b7e9d0af2 Lib/iSCSI: add the LUN Resize support
From SAM-4, section 5.13 (Sense Data);
“When a command terminates with a CHECK CONDITION status, sense data shall be returned
in the same I_T_L_Q nexus transaction (see 3.1.50) as the CHECK CONDITION status. After
the sense data is returned, it shall be cleared except when it is associated with a unit
attention condition and the UA_INTLCK_CTRL field in the Control mode page (see SPC-4)
contains 10b or 11b.”

SPDK does not set UA_INTLCK_CTRL to 10b or 11b, so we set the unit attention condition
immediately against a single IO or Admin IO after reporting it via a CHECK CONDITION.
Once the failed IO received at iSCSI initiator side, it will be retried. In the case of
resize operation, if there is no IO from iSCSI initiator side, the unit attention
condition will be delayed to report until the first IO is received at the iSCSI target
side.

Meanwhile, we clear the resizing (newly added) flag on our SCSI LUN structure after
first time we report the resize unit attention condition.

The kernel initiator won’t actually resize the corresponding block device automatically.
It will report a uevent, and then you can set up udev rules to trigger a rescan. SPDK
iSCSI initiator will automatically report the LUN size change.

Change-Id: Ifc85b8d4d3fbea13e76fb5d1faf1ac6c8f662e6c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11086
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-01-20 07:56:23 +00:00
..
aio bdev/aio: return void from bdev_aio_readv/writev 2021-09-02 07:42:31 +00:00
compress spelling: module 2021-11-30 09:05:32 +00:00
crypto spelling: module 2021-11-30 09:05:32 +00:00
delay bdev/delay: zero-copy support 2022-01-12 08:20:11 +00:00
error bdev/error: properly initialize value of num for inject_error RPC 2021-04-15 21:41:05 +00:00
ftl spelling: module 2021-11-30 09:05:32 +00:00
gpt spelling: module 2021-11-30 09:05:32 +00:00
iscsi Lib/iSCSI: add the LUN Resize support 2022-01-20 07:56:23 +00:00
lvol bdev/lvol: asserting lvol ptr before dereference 2021-08-24 07:18:54 +00:00
malloc bdev_malloc: exit early in case of no acceleration task 2022-01-14 08:35:32 +00:00
null lib/bdev: added spdk_bdev_module_fini_done() 2021-08-23 08:49:56 +00:00
nvme bdev/nvme: set default bdev_retry_count to 3 2022-01-19 08:55:46 +00:00
ocf spelling: module 2021-11-30 09:05:32 +00:00
passthru bdev: Add API to get SPDK memory domains used by bdev 2021-08-20 07:26:10 +00:00
pmem lib/bdev: added spdk_bdev_module_fini_done() 2021-08-23 08:49:56 +00:00
raid spelling: module 2021-11-30 09:05:32 +00:00
rbd bdev/rbd: Support config_param and config_file simultaneously for rbd_register_cluster 2022-01-17 09:44:56 +00:00
split splite/vbdev_split: Free base part bdev on the error path. 2021-03-02 08:02:58 +00:00
uring so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
virtio lib/bdev: added spdk_bdev_module_fini_done() 2021-08-23 08:49:56 +00:00
zone_block spelling: module 2021-11-30 09:05:32 +00:00
Makefile bdev: move bdev_rpc library contents 2020-09-25 11:43:42 +00:00