Skip to content

Commit 3dd1680

Browse files
committed
io-wq: cancel request if it's asking for files and we don't have them
This can't currently happen, but will be possible shortly. Handle missing files just like we do not being able to grab a needed mm, and mark the request as needing cancelation. Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 3cea11c commit 3dd1680

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/io-wq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,10 @@ static void io_impersonate_work(struct io_worker *worker,
482482
current->files = work->identity->files;
483483
current->nsproxy = work->identity->nsproxy;
484484
task_unlock(current);
485+
if (!work->identity->files) {
486+
/* failed grabbing files, ensure work gets cancelled */
487+
work->flags |= IO_WQ_WORK_CANCEL;
488+
}
485489
}
486490
if ((work->flags & IO_WQ_WORK_FS) && current->fs != work->identity->fs)
487491
current->fs = work->identity->fs;

0 commit comments

Comments
 (0)