Skip to content

Commit 55fbb9a

Browse files
Ming Leiaxboe
authored andcommitted
ublk: fix UBLK_CMD_DEL_DEV_ASYNC handling
In ublk_ctrl_uring_cmd(), ioctl command NR should be used for matching _IOC_NR(cmd_op). Fix it by adding one private macro, and this way is clean. Fixes: 13fe8e6 ("ublk: add UBLK_CMD_DEL_DEV_ASYNC") Signed-off-by: Ming Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 7e04da2 commit 55fbb9a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/block/ublk_drv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848

4949
#define UBLK_MINORS (1U << MINORBITS)
5050

51+
/* private ioctl command mirror */
52+
#define UBLK_CMD_DEL_DEV_ASYNC _IOC_NR(UBLK_U_CMD_DEL_DEV_ASYNC)
53+
5154
/* All UBLK_F_* have to be included into UBLK_F_ALL */
5255
#define UBLK_F_ALL (UBLK_F_SUPPORT_ZERO_COPY \
5356
| UBLK_F_URING_CMD_COMP_IN_TASK \
@@ -2903,7 +2906,7 @@ static int ublk_ctrl_uring_cmd(struct io_uring_cmd *cmd,
29032906
case UBLK_CMD_DEL_DEV:
29042907
ret = ublk_ctrl_del_dev(&ub, true);
29052908
break;
2906-
case UBLK_U_CMD_DEL_DEV_ASYNC:
2909+
case UBLK_CMD_DEL_DEV_ASYNC:
29072910
ret = ublk_ctrl_del_dev(&ub, false);
29082911
break;
29092912
case UBLK_CMD_GET_QUEUE_AFFINITY:

0 commit comments

Comments
 (0)