mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-15 11:44:11 +00:00
open: make RESOLVE_CACHED correctly test for O_TMPFILE
commita0fc452a5d
upstream. O_TMPFILE is actually __O_TMPFILE|O_DIRECTORY. This means that the old fast-path check for RESOLVE_CACHED would reject all users passing O_DIRECTORY with -EAGAIN, when in fact the intended test was to check for __O_TMPFILE. Cc: stable@vger.kernel.org # v5.12+ Fixes:99668f6180
("fs: expose LOOKUP_CACHED through openat2() RESOLVE_CACHED") Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-Id: <20230806-resolve_cached-o_tmpfile-v1-1-7ba16308465e@cyphar.com> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b7f15617a1
commit
ae7ddaf2f9
1 changed files with 1 additions and 1 deletions
|
@ -1126,7 +1126,7 @@ inline int build_open_flags(const struct open_how *how, struct open_flags *op)
|
|||
lookup_flags |= LOOKUP_IN_ROOT;
|
||||
if (how->resolve & RESOLVE_CACHED) {
|
||||
/* Don't bother even trying for create/truncate/tmpfile open */
|
||||
if (flags & (O_TRUNC | O_CREAT | O_TMPFILE))
|
||||
if (flags & (O_TRUNC | O_CREAT | __O_TMPFILE))
|
||||
return -EAGAIN;
|
||||
lookup_flags |= LOOKUP_CACHED;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue