linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Backport statx(..., NULL, AT_EMPTY_PATH, ...)
@ 2024-09-18 14:10 Miao Wang via B4 Relay
  2024-09-18 14:10 ` [PATCH v5.15-v5.10 1/4] vfs: mostly undo glibc turning 'fstat()' into 'fstatat(AT_EMPTY_PATH)' Miao Wang via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Miao Wang via B4 Relay @ 2024-09-18 14:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, stable
  Cc: Xi Ruoyao, Mateusz Guzik, Christian Brauner, Alexander Viro,
	linux-fsdevel, stable, Miao Wang, Linus Torvalds

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. Modifications
are applied to vfs_statx_path(). In the original patch, vfs_statx_path()
was created to warp around the call to vfs_getattr() after
filename_lookup() in vfs_statx(). Since the coresponding code is
different in 5.15 and 5.10, the content of vfs_statx_path() is modified
to match this. The original patch also moved path_mounted() from
namespace.c to internal.h, which is not applicable for 5.15 and 5.10
since it has not been introduced before 6.5. The original patch also
used CLASS(fd_raw, ) to convert a file descriptor number provided from
the user space in to a struct and automatically release it afterwards.
Since CLASS mechanism is only available since 6.1.79, obtaining and
releasing fd struct is done manually. do_statx() was directly handling
filename string instead of a struct filename * before 5.18, as a result
short-circuiting is implemented in do_statx() instead of sys_statx,
without the need of introducing do_statx_fd().

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

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          | 73 +++++++++++++++++++++++++++++++++++++++++++++---------
 include/linux/fs.h | 17 +++++++++++++
 2 files changed, 78 insertions(+), 12 deletions(-)
---
base-commit: 3a5928702e7120f83f703fd566082bfb59f1a57e
change-id: 20240918-statx-stable-linux-5-15-y-9a30358a7d47

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-18 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18 14:10 [PATCH 0/4] Backport statx(..., NULL, AT_EMPTY_PATH, ...) Miao Wang via B4 Relay
2024-09-18 14:10 ` [PATCH v5.15-v5.10 1/4] vfs: mostly undo glibc turning 'fstat()' into 'fstatat(AT_EMPTY_PATH)' Miao Wang via B4 Relay
2024-09-18 14:10 ` [PATCH v5.15-v5.10 2/4] fs: new helper vfs_empty_path() Miao Wang via B4 Relay
2024-09-18 14:10 ` [PATCH v5.15-v5.10 3/4] stat: use vfs_empty_path() helper Miao Wang via B4 Relay
2024-09-18 14:10 ` [PATCH v5.15-v5.10 4/4] vfs: support statx(..., NULL, AT_EMPTY_PATH, ...) Miao Wang via B4 Relay

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).