linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miao Wang via B4 Relay <devnull+shankerwangmiao.gmail.com@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org
Cc: Xi Ruoyao <xry111@xry111.site>,
	Christian Brauner <brauner@kernel.org>,
	 Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,  stable@vger.kernel.org,
	Miao Wang <shankerwangmiao@gmail.com>,
	 Christoph Hellwig <hch@lst.de>,
	 Linus Torvalds <torvalds@linux-foundation.org>,
	 Mateusz Guzik <mjguzik@gmail.com>
Subject: [PATCH 0/6] Backport statx(..., NULL, AT_EMPTY_PATH, ...)
Date: Wed, 18 Sep 2024 22:12:19 +0800	[thread overview]
Message-ID: <20240918-statx-stable-linux-5-4-y-v1-0-8a771c9bbe5f@gmail.com> (raw)

Commit 0ef625bba6fb ("vfs: support statx(..., NULL, AT_EMPTY_PATH,
...)") added support for passing in NULL when AT_EMPTY_PATH is given,
improving performance when statx is used for fetching stat informantion
from a given fd, which is especially important for 32-bit platforms.
This commit also improved the performance when an empty string is given
by short-circuiting the handling of such paths.

This series is based on the commits in the Linus’ tree. Comparing to the
original patches, the helper vfs_empty_path() is moved to stat.c from
linux/fs.h, because get_user() is only available in fs.h since v5.7,
where commit 80fbaf1c3f29 ('rcuwait: Add @State argument to
rcuwait_wait_event()') added linux/sched/signal.h to rcuwait.h, and
uaccess.h finally got its way to fs.h along the path uaccess.h -> 
sched/task.h -> sched/signal.h -> rcuwait.h -> percpu-rwsem.h -> fs.h.
uaccess.h cannot be directly included in fs.h before v5.7, where commit
df23e2be3d24 ('acpi: Remove header dependency') removed proc_fs.h from
acpi/acpi_bus.h, preventing arch/x86/boot/compressed/cmdline.c from
indirectly including fs.h. Otherwise, the function set_fs() defined in
asm/uaccess.h will get into cmdline.c, which contains another set_fs(),
resulting conflicting function definations. There is no users of
vfs_empty_path() except stat.c, and as a result, putting it in stat.c is
acceptable.

The existing vfs_statx_fd(), which is removed since v5.10, is utilized
to implement short-circuit handling of NULL and "" paths, instead of
introducing vfs_statx_path(), simplifying the implementation.

Tested-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
---
Christian Brauner (2):
      fs: new helper vfs_empty_path()
      stat: use vfs_empty_path() helper

Christoph Hellwig (2):
      fs: implement vfs_stat and vfs_lstat in terms of vfs_fstatat
      fs: move vfs_fstatat out of line

Linus Torvalds (1):
      vfs: mostly undo glibc turning 'fstat()' into 'fstatat(AT_EMPTY_PATH)'

Mateusz Guzik (1):
      vfs: support statx(..., NULL, AT_EMPTY_PATH, ...)

 fs/stat.c          | 58 +++++++++++++++++++++++++++++++++++++++++++++++++-----
 include/linux/fs.h | 26 ++++++++++--------------
 2 files changed, 63 insertions(+), 21 deletions(-)
---
base-commit: 661f109c057497c8baf507a2562ceb9f9fb3cbc2
change-id: 20240918-statx-stable-linux-5-4-y-a79d4268600d

Best regards,
-- 
Miao Wang <shankerwangmiao@gmail.com>



             reply	other threads:[~2024-09-18 14:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 14:12 Miao Wang via B4 Relay [this message]
2024-09-18 14:12 ` [PATCH v5.4-v4.19 1/6] fs: implement vfs_stat and vfs_lstat in terms of vfs_fstatat Miao Wang via B4 Relay
2024-09-18 14:12 ` [PATCH v5.4-v4.19 2/6] fs: move vfs_fstatat out of line Miao Wang via B4 Relay
2024-09-18 14:12 ` [PATCH v5.4-v4.19 3/6] vfs: mostly undo glibc turning 'fstat()' into 'fstatat(AT_EMPTY_PATH)' Miao Wang via B4 Relay
2024-09-18 14:12 ` [PATCH v5.4-v4.19 4/6] fs: new helper vfs_empty_path() Miao Wang via B4 Relay
2024-09-18 14:12 ` [PATCH v5.4-v4.19 5/6] stat: use vfs_empty_path() helper Miao Wang via B4 Relay
2024-09-18 14:12 ` [PATCH v5.4-v4.19 6/6] vfs: support statx(..., NULL, AT_EMPTY_PATH, ...) Miao Wang via B4 Relay

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=20240918-statx-stable-linux-5-4-y-v1-0-8a771c9bbe5f@gmail.com \
    --to=devnull+shankerwangmiao.gmail.com@kernel.org \
    --cc=brauner@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=shankerwangmiao@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xry111@xry111.site \
    /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;
as well as URLs for NNTP newsgroup(s).