aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorCaleb Sander Mateos <csander@purestorage.com>2025-02-28 16:14:31 -0700
committerJens Axboe <axboe@kernel.dk>2025-02-28 19:15:05 -0700
commite6ea7ec494881bcf61b8f0f77f7cb3542f717ff2 (patch)
tree4e47f2956a0d392df239cc96e78655f634f64cad /drivers/block
parentio_uring: convert cmd_to_io_kiocb() macro to function (diff)
downloadlinux-e6ea7ec494881bcf61b8f0f77f7cb3542f717ff2.tar.gz
linux-e6ea7ec494881bcf61b8f0f77f7cb3542f717ff2.zip
io_uring/ublk: report error when unregister operation fails
Indicate to userspace applications if a UBLK_IO_UNREGISTER_IO_BUF command specifies an invalid buffer index by returning an error code. Return -EINVAL if no buffer is registered with the given index, and -EBUSY if the registered buffer is not a kernel bvec. Signed-off-by: Caleb Sander Mateos <csander@purestorage.com> Link: https://lore.kernel.org/r/20250228231432.642417-1-csander@purestorage.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/ublk_drv.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index b5cf92baaf0f..512cbd456817 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -1787,8 +1787,7 @@ static int ublk_unregister_io_buf(struct io_uring_cmd *cmd,
const struct ublksrv_io_cmd *ub_cmd,
unsigned int issue_flags)
{
- io_buffer_unregister_bvec(cmd, ub_cmd->addr, issue_flags);
- return 0;
+ return io_buffer_unregister_bvec(cmd, ub_cmd->addr, issue_flags);
}
static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd,