Skip to content

Commit 53c9592

Browse files
ps-ushankaraxboe
authored andcommitted
selftests: ublk: kublk: use ioctl-encoded opcodes
There are a couple of places in the kublk selftests ublk server which use the legacy ublk opcodes. These operations fail (with -EOPNOTSUPP) on a kernel compiled without CONFIG_BLKDEV_UBLK_LEGACY_OPCODES set. We could easily require it to be set as a prerequisite for these selftests, but since new applications should not be using the legacy opcodes, use the ioctl-encoded opcodes everywhere in kublk. Signed-off-by: Uday Shankar <ushankar@purestorage.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20250401-ublk_selftests-v1-1-98129c9bc8bb@purestorage.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent fcfd94d commit 53c9592

File tree

1 file changed

+2
-2
lines changed
  • tools/testing/selftests/ublk

1 file changed

+2
-2
lines changed

tools/testing/selftests/ublk/kublk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static int __ublk_ctrl_cmd(struct ublk_dev *dev,
9999
static int ublk_ctrl_stop_dev(struct ublk_dev *dev)
100100
{
101101
struct ublk_ctrl_cmd_data data = {
102-
.cmd_op = UBLK_CMD_STOP_DEV,
102+
.cmd_op = UBLK_U_CMD_STOP_DEV,
103103
};
104104

105105
return __ublk_ctrl_cmd(dev, &data);
@@ -169,7 +169,7 @@ static int ublk_ctrl_get_params(struct ublk_dev *dev,
169169
struct ublk_params *params)
170170
{
171171
struct ublk_ctrl_cmd_data data = {
172-
.cmd_op = UBLK_CMD_GET_PARAMS,
172+
.cmd_op = UBLK_U_CMD_GET_PARAMS,
173173
.flags = CTRL_CMD_HAS_BUF,
174174
.addr = (__u64)params,
175175
.len = sizeof(*params),

0 commit comments

Comments
 (0)