public inbox for [email protected]
 help / color / mirror / Atom feed
From: Aleksa Sarai <[email protected]>
To: Alexander Viro <[email protected]>,
	Christian Brauner <[email protected]>,
	Jens Axboe <[email protected]>,
	Pavel Begunkov <[email protected]>
Cc: [email protected], [email protected],
	[email protected], Aleksa Sarai <[email protected]>,
	[email protected]
Subject: [PATCH v2 0/2] open: make RESOLVE_CACHED correctly test for O_TMPFILE
Date: Sun, 06 Aug 2023 08:48:07 +1000	[thread overview]
Message-ID: <[email protected]> (raw)

There were a few places that were incorrectly testing for whether an
open(2) operation was O_TMPFILE by doing (flags & O_TMPFILE). As
O_TMPFILE is defined as __O_TMPFILE|O_DIRECTORY, this would cause the
code to assume that O_DIRECTORY is equivalent to O_TMPFILE.

The only places where this happened were in RESOLVE_CACHED and
io_uring's checking related to RESOLVE_CACHED, so the only bug this
really fixes is that now O_DIRECTORY will no longer cause RESOLVE_CACHED
to always fail with -EAGAIN (and io_uring will thus be faster when doing
O_DIRECTORY opens).

Signed-off-by: Aleksa Sarai <[email protected]>
---
Changes in v2:
- fix io_uring's io_openat_force_async as well.
- v1: <https://lore.kernel.org/r/[email protected]>

---
Aleksa Sarai (2):
      open: make RESOLVE_CACHED correctly test for O_TMPFILE
      io_uring: correct check for O_TMPFILE

 fs/open.c            | 2 +-
 io_uring/openclose.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
base-commit: bf5ad7af0516cb47121dae1b1c160e4385615274
change-id: 20230806-resolve_cached-o_tmpfile-978cb238bd68

Best regards,
-- 
Aleksa Sarai <[email protected]>


             reply	other threads:[~2023-08-05 22:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-05 22:48 Aleksa Sarai [this message]
2023-08-05 22:48 ` [PATCH v2 1/2] open: make RESOLVE_CACHED correctly test for O_TMPFILE Aleksa Sarai
2023-08-05 22:48 ` [PATCH v2 2/2] io_uring: correct check " Aleksa Sarai
2023-08-06  0:29   ` Jens Axboe
2023-08-06  6:42     ` Aleksa Sarai
2023-08-06 16:41       ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230806-resolve_cached-o_tmpfile-v2-0-058bff24fb16@cyphar.com \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox