Skip to content

Commit 224e858

Browse files
Ming Leiaxboe
authored andcommitted
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: 71f28f3 ("ublk_drv: add io_uring based userspace block driver") Signed-off-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com> Link: https://lore.kernel.org/r/20221029010432.598367-2-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e3c5a78 commit 224e858

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/block/ublk_drv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,9 @@ static int ublk_ctrl_add_dev(struct io_uring_cmd *cmd)
16581658
*/
16591659
ub->dev_info.flags &= UBLK_F_ALL;
16601660

1661+
if (!IS_BUILTIN(CONFIG_BLK_DEV_UBLK))
1662+
ub->dev_info.flags |= UBLK_F_URING_CMD_COMP_IN_TASK;
1663+
16611664
/* We are not ready to support zero copy */
16621665
ub->dev_info.flags &= ~UBLK_F_SUPPORT_ZERO_COPY;
16631666

0 commit comments

Comments
 (0)