]> git.hungrycats.org Git - linux/commitdiff
ublk: fix error code for unsupported command
authorMing Lei <ming.lei@redhat.com>
Tue, 19 Nov 2024 03:06:46 +0000 (11:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2024 09:32:53 +0000 (10:32 +0100)
commit 34c1227035b3ab930a1ae6ab6f22fec1af8ab09e upstream.

ENOTSUPP is for kernel use only, and shouldn't be sent to userspace.

Fix it by replacing it with EOPNOTSUPP.

Cc: stable@vger.kernel.org
Fixes: bfbcef036396 ("ublk_drv: move ublk_get_device_from_id into ublk_ctrl_uring_cmd")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20241119030646.2319030-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/ublk_drv.c

index 81bd9c5040334728e35a0f07578201072e9f0cb4..1105e8adf7f96fdd5607c71bbf3e9806c28a80d9 100644 (file)
@@ -2913,7 +2913,7 @@ static int ublk_ctrl_uring_cmd(struct io_uring_cmd *cmd,
                ret = ublk_ctrl_end_recovery(ub, cmd);
                break;
        default:
-               ret = -ENOTSUPP;
+               ret = -EOPNOTSUPP;
                break;
        }