Fix a couple of issues I saw when developing selftests for ublk. These patches are split out from the following series:
https://lore.kernel.org/linux-block/20250325-ublk_timeout-v1-0-262f0121a7bd@...
Signed-off-by: Uday Shankar ushankar@purestorage.com --- Uday Shankar (2): selftests: ublk: kublk: use ioctl-encoded opcodes selftests: ublk: kublk: fix an error log line
tools/testing/selftests/ublk/kublk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- base-commit: 4cfcc398357b0fb3d4c97d47d4a9e3c0653b7903 change-id: 20250325-ublk_selftests-6a055dfbc55b
Best regards,
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 --- tools/testing/selftests/ublk/kublk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/ublk/kublk.c b/tools/testing/selftests/ublk/kublk.c index 83756f97c26eecc984da55b8717e99b89470b904..d39f166c9dc31721381184fb27d68347ecab81b6 100644 --- a/tools/testing/selftests/ublk/kublk.c +++ b/tools/testing/selftests/ublk/kublk.c @@ -99,7 +99,7 @@ static int __ublk_ctrl_cmd(struct ublk_dev *dev, static int ublk_ctrl_stop_dev(struct ublk_dev *dev) { struct ublk_ctrl_cmd_data data = { - .cmd_op = UBLK_CMD_STOP_DEV, + .cmd_op = UBLK_U_CMD_STOP_DEV, };
return __ublk_ctrl_cmd(dev, &data); @@ -169,7 +169,7 @@ static int ublk_ctrl_get_params(struct ublk_dev *dev, struct ublk_params *params) { struct ublk_ctrl_cmd_data data = { - .cmd_op = UBLK_CMD_GET_PARAMS, + .cmd_op = UBLK_U_CMD_GET_PARAMS, .flags = CTRL_CMD_HAS_BUF, .addr = (__u64)params, .len = sizeof(*params),
When doing io_uring operations using liburing, errno is not used to indicate errors, so the %m format specifier does not provide any relevant information for failed io_uring commands. Fix a log line emitted on get_params failure to translate the error code returned in the cqe->res field instead.
Signed-off-by: Uday Shankar ushankar@purestorage.com Reviewed-by: Ming Lei ming.lei@redhat.com --- tools/testing/selftests/ublk/kublk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ublk/kublk.c b/tools/testing/selftests/ublk/kublk.c index d39f166c9dc31721381184fb27d68347ecab81b6..91c282bc767449a418cce7fc816dc8e9fc732d6a 100644 --- a/tools/testing/selftests/ublk/kublk.c +++ b/tools/testing/selftests/ublk/kublk.c @@ -215,7 +215,7 @@ static void ublk_ctrl_dump(struct ublk_dev *dev)
ret = ublk_ctrl_get_params(dev, &p); if (ret < 0) { - ublk_err("failed to get params %m\n"); + ublk_err("failed to get params %d %s\n", ret, strerror(-ret)); return; }
On Tue, 01 Apr 2025 14:49:07 -0600, Uday Shankar wrote:
Fix a couple of issues I saw when developing selftests for ublk. These patches are split out from the following series:
https://lore.kernel.org/linux-block/20250325-ublk_timeout-v1-0-262f0121a7bd@...
Applied, thanks!
[1/2] selftests: ublk: kublk: use ioctl-encoded opcodes (no commit info) [2/2] selftests: ublk: kublk: fix an error log line (no commit info)
Best regards,
On Wed, Apr 02, 2025 at 07:12:45AM -0600, Jens Axboe wrote:
On Tue, 01 Apr 2025 14:49:07 -0600, Uday Shankar wrote:
Fix a couple of issues I saw when developing selftests for ublk. These patches are split out from the following series:
https://lore.kernel.org/linux-block/20250325-ublk_timeout-v1-0-262f0121a7bd@...
Applied, thanks!
[1/2] selftests: ublk: kublk: use ioctl-encoded opcodes (no commit info) [2/2] selftests: ublk: kublk: fix an error log line (no commit info)
Jens, MAINTAINERS parsing didn't add you to this email - I had to do it manually. Do we need to add you somewhere so you get a copy of all ublk patches (since you maintain its tree)?
On 4/2/25 1:34 PM, Uday Shankar wrote:
On Wed, Apr 02, 2025 at 07:12:45AM -0600, Jens Axboe wrote:
On Tue, 01 Apr 2025 14:49:07 -0600, Uday Shankar wrote:
Fix a couple of issues I saw when developing selftests for ublk. These patches are split out from the following series:
https://lore.kernel.org/linux-block/20250325-ublk_timeout-v1-0-262f0121a7bd@...
Applied, thanks!
[1/2] selftests: ublk: kublk: use ioctl-encoded opcodes (no commit info) [2/2] selftests: ublk: kublk: fix an error log line (no commit info)
Jens, MAINTAINERS parsing didn't add you to this email - I had to do it manually. Do we need to add you somewhere so you get a copy of all ublk patches (since you maintain its tree)?
It's under ublk, so it should go to linux-block. That should be good enough, I'll see them.
linux-kselftest-mirror@lists.linaro.org