]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs: add support for LOOKUP_CACHED
authorJens Axboe <axboe@kernel.dk>
Thu, 17 Dec 2020 16:19:09 +0000 (09:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jan 2023 10:39:16 +0000 (11:39 +0100)
commitc1fe7bd3e1aa85865396b464b31f28b094a4353c
treec3c4edd9fdbd65357170aada7f997fa9a7e82cf9
parent36ec31201a3da85a112dd368be04aee05c713459
fs: add support for LOOKUP_CACHED

[ Upstream commit 6c6ec2b0a3e0381d886d531bd1471dfdb1509237 ]

io_uring always punts opens to async context, since there's no control
over whether the lookup blocks or not. Add LOOKUP_CACHED to support
just doing the fast RCU based lookups, which we know will not block. If
we can do a cached path resolution of the filename, then we don't have
to always punt lookups for a worker.

During path resolution, we always do LOOKUP_RCU first. If that fails and
we terminate LOOKUP_RCU, then fail a LOOKUP_CACHED attempt as well.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/namei.c
include/linux/namei.h