Skip to content

Commit 9c53033

Browse files
committed
libnvme/ioctl: limit to use NVME_IOCTL_IO64_CMD only for block dev
Since currently NVME_IOCTL_IO64_CMD not supported for the char dev. Currently the char dev nvmeX not able be used for the io-passthru command. Also previously NVME_IOCTL_IO_CMD used for the io-passthru command. Therefore for the char dev nvmeX use NVME_IOCTL_IO_CMD instead. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 51bc794 commit 9c53033

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libnvme/src/nvme/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int nvme_submit_passthru64(struct nvme_transport_handle *hdl,
178178
int nvme_submit_io_passthru(struct nvme_transport_handle *hdl,
179179
struct nvme_passthru_cmd *cmd)
180180
{
181-
if (hdl->ioctl64)
181+
if (hdl->ioctl64 && S_ISBLK(hdl->stat.st_mode))
182182
return nvme_submit_passthru64(hdl, NVME_IOCTL_IO64_CMD, cmd);
183183
return nvme_submit_passthru32(hdl, NVME_IOCTL_IO_CMD, cmd);
184184
}

0 commit comments

Comments
 (0)