Skip to content

Commit ef04688

Browse files
committed
io_uring: don't block level reissue off completion path
Some setups, like SCSI, can throw spurious -EAGAIN off the softirq completion path. Normally we expect this to happen inline as part of submission, but apparently SCSI has a weird corner case where it can happen as part of normal completions. This should be solved by having the -EAGAIN bubble back up the stack as part of submission, but previous attempts at this failed and we're not just quite there yet. Instead we currently use REQ_F_REISSUE to handle this case. For now, catch it in io_rw_should_reissue() and prevent a reissue from a bogus path. Cc: [email protected] Reported-by: Fabian Ebner <[email protected]> Tested-by: Fabian Ebner <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 773af69 commit ef04688

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/io_uring.c

+6
Original file line numberDiff line numberDiff line change
@@ -2447,6 +2447,12 @@ static bool io_rw_should_reissue(struct io_kiocb *req)
24472447
*/
24482448
if (percpu_ref_is_dying(&ctx->refs))
24492449
return false;
2450+
/*
2451+
* Play it safe and assume not safe to re-import and reissue if we're
2452+
* not in the original thread group (or in task context).
2453+
*/
2454+
if (!same_thread_group(req->task, current) || !in_task())
2455+
return false;
24502456
return true;
24512457
}
24522458
#else

0 commit comments

Comments
 (0)