io_uring/io-wq: don't use static creds/mm assignments
authorJens Axboe <axboe@kernel.dk>
Mon, 27 Jan 2020 23:34:48 +0000 (16:34 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 27 Jan 2020 23:39:19 +0000 (16:39 -0700)
commit0e6e5f6e8b2ad945d4be2053722601e6382d151d
tree68ab5fdeeaca97219d78d69156f787f4ec969242
parent848f7e1887c46f21679c2c12b9e8022f17750721
io_uring/io-wq: don't use static creds/mm assignments

We currently setup the io_wq with a static set of mm and creds. Even for
a single-use io-wq per io_uring, this is suboptimal as we have may have
multiple enters of the ring. For sharing the io-wq backend, it doesn't
work at all.

Switch to passing in the creds and mm when the work item is setup. This
means that async work is no longer deferred to the io_uring mm and creds,
it is done with the current mm and creds.

Flag this behavior with IORING_FEAT_CUR_PERSONALITY, so applications know
they can rely on the current personality (mm and creds) being the same
for direct issue and async issue.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c
fs/io-wq.h
fs/io_uring.c
include/uapi/linux/io_uring.h