diff options
author | Ming Lei <ming.lei@redhat.com> | 2025-07-13 22:33:59 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-07-15 08:04:16 -0600 |
commit | 07bc706431799e7cf5209e8afdd8071d400266e7 (patch) | |
tree | 90af82955dcffa276cb9ef3dd50c1bb76bdeac34 | |
parent | 7074feeca41d09713d70e619a34d9e7b4e219f8c (diff) |
ublk: let ublk_fill_io_cmd() cover more things
Let ublk_fill_io_cmd() clear UBLK_IO_FLAG_OWNED_BY_SRV too.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250713143415.2857561-5-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/ublk_drv.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 73c6c8d3b117..f251517baea3 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -2014,6 +2014,8 @@ static inline void ublk_fill_io_cmd(struct ublk_io *io, { io->cmd = cmd; io->flags |= UBLK_IO_FLAG_ACTIVE; + /* now this cmd slot is owned by ublk driver */ + io->flags &= ~UBLK_IO_FLAG_OWNED_BY_SRV; io->addr = buf_addr; } @@ -2229,9 +2231,6 @@ static int ublk_commit_and_fetch(const struct ublk_queue *ubq, } ublk_fill_io_cmd(io, cmd, ub_cmd->addr); - - /* now this cmd slot is owned by ublk driver */ - io->flags &= ~UBLK_IO_FLAG_OWNED_BY_SRV; io->res = ub_cmd->result; if (req_op(req) == REQ_OP_ZONE_APPEND) @@ -2353,7 +2352,6 @@ static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd, */ req = io->req; ublk_fill_io_cmd(io, cmd, ub_cmd->addr); - io->flags &= ~UBLK_IO_FLAG_OWNED_BY_SRV; if (likely(ublk_get_data(ubq, io, req))) { __ublk_prep_compl_io_cmd(io, req); return UBLK_IO_RES_OK; |