]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ublk: prepare for not tracking task context for command batch
authorMing Lei <ming.lei@redhat.com>
Fri, 16 Jan 2026 14:18:35 +0000 (22:18 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 23 Jan 2026 03:05:40 +0000 (20:05 -0700)
batch io is designed to be independent of task context, and we will not
track task context for batch io feature.

Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c

index f6a4b222c71a4d19c7874612d84cc9fbca6dc1f6..0f9fcd16258b2bf09d268e828f8a00ad7a12e695 100644 (file)
@@ -2423,7 +2423,10 @@ static int __ublk_fetch(struct io_uring_cmd *cmd, struct ublk_device *ub,
 
        ublk_fill_io_cmd(io, cmd);
 
-       WRITE_ONCE(io->task, get_task_struct(current));
+       if (ublk_dev_support_batch_io(ub))
+               WRITE_ONCE(io->task, NULL);
+       else
+               WRITE_ONCE(io->task, get_task_struct(current));
        ublk_mark_io_ready(ub);
 
        return 0;