aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMing Lei <[email protected]>2022-10-29 09:04:29 +0800
committerJens Axboe <[email protected]>2022-10-31 07:23:16 -0600
commit224e858f215a3d6304f95a92357a1753475ca9cf (patch)
tree8940ceac8fdef5b9988c912b508bb838f0034c1f
parente3c5a78cdb6237bfb9641b63cccf366325229eec (diff)
ublk_drv: return flag of UBLK_F_URING_CMD_COMP_IN_TASK in case of module
UBLK_F_URING_CMD_COMP_IN_TASK needs to be set and returned to userspace if ublk driver is built as module, otherwise userspace may get wrong flags shown. Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver") Signed-off-by: Ming Lei <[email protected]> Reviewed-by: ZiyangZhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--drivers/block/ublk_drv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index 5afce6ffaadf..6b2f214f0d5c 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -1658,6 +1658,9 @@ static int ublk_ctrl_add_dev(struct io_uring_cmd *cmd)
*/
ub->dev_info.flags &= UBLK_F_ALL;
+ if (!IS_BUILTIN(CONFIG_BLK_DEV_UBLK))
+ ub->dev_info.flags |= UBLK_F_URING_CMD_COMP_IN_TASK;
+
/* We are not ready to support zero copy */
ub->dev_info.flags &= ~UBLK_F_SUPPORT_ZERO_COPY;