numam-spdk/lib
Michal Berger ca0339d8e5 nvme_cuse: Return ENOTTY in case unsupported ioctl is sent to a device
Latest nvme-cli (>= 1.13) fails to issue commands towards SPDK's cuse
ctrl device, e.g.:

$ nvme get-feature /dev/spdk/nvme0 -f 1 -s 1 -l 100
nvme_cuse.c: 654:cuse_ctrlr_ioctl: *ERROR*: Unsupported IOCTL 0x4E40.
get-namespace-id: Invalid argument

The reason is because nvme-cli now also sends NVME_IOCTL_ID to the
target device to determine if it's indeed a controller or a ns. In
case kernel returns ENOTTY then nvme-cli considers the device to be
a controller. Since cuse_ctrlr_ioctl() returns EINVAL in such a case
the nvme-cli fails.

To avoid this simply replace EINVAL with ENOTTY for the ioctls that
may be not supported by ctrl or ns device.

nvme-cli commit in question:
fa2b91da74

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I29003864bc2a5c1a8906d6d01beba3d6f4e31b0e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8531
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-13 09:00:05 +00:00
..
accel lib/accel: add suport for batching copy + CRC32C command 2021-06-09 07:26:00 +00:00
bdev bdev: Hold mutex while removing name from name tree 2021-07-12 15:30:39 +00:00
blob blobstore:fix memleak problem in blob_load_cpl() 2021-06-17 09:02:37 +00:00
blobfs lib/trace: record string arguments as (const char *) 2021-06-28 16:17:35 +00:00
conf so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
env_dpdk configure: Build against installed DPDK instance 2021-06-29 18:17:43 +00:00
env_ocf lib/thead: print error log when create mempool or ring failed 2020-11-05 09:41:06 +00:00
event lib/app: only print cpumask for thread within app core mask 2021-07-12 21:58:56 +00:00
ftl lib/trace: don't format arg's name while registering a tpoint 2021-06-10 10:58:05 +00:00
idxd lib/idxd: update some func params for consistency 2021-06-29 00:46:25 +00:00
init event: Move json config loading to init 2021-05-26 09:13:34 +00:00
ioat ioat: fix potential double free problem in ioat_channel_start() 2021-06-16 09:00:37 +00:00
iscsi net: Remove library 2021-07-13 08:57:58 +00:00
json so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
jsonrpc jsonrpc: use SOCK_NONBLOCK in socket() calls 2021-05-05 13:31:10 +00:00
log so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
lvol so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
nbd lib/nbd: refine nbd stop process 2021-06-15 08:49:10 +00:00
notify so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
nvme nvme_cuse: Return ENOTTY in case unsupported ioctl is sent to a device 2021-07-13 09:00:05 +00:00
nvmf nvme: Rename cmic.multi_host by cmic.multi_ctrlr of spdk_nvme_ctrlr_data 2021-07-13 08:57:33 +00:00
rdma include: remove util.h include from queue_extras.h 2021-04-14 07:25:21 +00:00
reduce so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
rocksdb Fix Rocksdb db_bench build's Linker issue. 2021-07-13 08:59:24 +00:00
rpc so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
scsi lib/trace: don't pass zero as a non-argument 2021-06-28 16:17:35 +00:00
sock net: Remove library 2021-07-13 08:57:58 +00:00
thread thread: Make the definition of struct spdk_io_channel private 2021-06-25 05:01:45 +00:00
trace trace: fix the snprintf warning issue. 2021-07-12 14:06:43 +00:00
ut_mock so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
util util/crc32c: Add spdk_crc32c_iov_update. 2021-06-02 11:37:17 +00:00
vfio_user libvfio-user: update submodule 2021-06-22 23:42:02 +00:00
vhost vhost-blk: use device name for VIRTIO_BLK_T_GET_ID 2021-05-27 07:35:37 +00:00
virtio env: only pass failing address to spdk_pci_error_handler 2021-06-15 08:34:28 +00:00
vmd so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
Makefile net: Remove library 2021-07-13 08:57:58 +00:00