[PATCH 1/2] vfs: support fstatat(..., NULL, AT_EMPTY_PATH | AT_NO_AUTOMOUNT, ...)
From: Xi Ruoyao
Date: Mon Oct 07 2024 - 09:09:03 EST
- Next message: Xi Ruoyao: "[PATCH 2/2] vfs: Make sure {statx,fstatat}(..., AT_EMPTY_PATH | ..., NULL, ...) behave as (..., AT_EMPTY_PATH | ..., "", ...)"
- Previous message: Thorsten Blum: "[RESEND PATCH] ext4: Annotate struct fname with __counted_by()"
- In reply to: Xi Ruoyao: "[PATCH 0/2] vfs: fstatat, statx: Consistently accept AT_EMPTY_PATH and NULL path"
- Next in thread: Xi Ruoyao: "[PATCH 2/2] vfs: Make sure {statx,fstatat}(..., AT_EMPTY_PATH | ..., NULL, ...) behave as (..., AT_EMPTY_PATH | ..., "", ...)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Since Linux 4.11 AT_NO_AUTOMOUNT is implied for fstatat. So we should
support this like fstatat(..., NULL, AT_EMPTY_PATH, ...) for
consistency. Also note that statx(..., NULL, AT_EMPTY_PATH |
AT_NO_AUTOMOUNT) is already supported.
Fixes: 27a2d0cb2f38 ("stat: use vfs_empty_path() helper")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Xi Ruoyao <xry111@xxxxxxxxxxx>
---
fs/stat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/stat.c b/fs/stat.c
index 41e598376d7e..ed9d4fd8ba2c 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -334,6 +334,7 @@ int vfs_fstatat(int dfd, const char __user *filename,
* If AT_EMPTY_PATH is set, we expect the common case to be that
* empty path, and avoid doing all the extra pathname work.
*/
+ flags &= ~AT_NO_AUTOMOUNT;
if (flags == AT_EMPTY_PATH && vfs_empty_path(dfd, filename))
return vfs_fstat(dfd, stat);
--
2.46.2
- Next message: Xi Ruoyao: "[PATCH 2/2] vfs: Make sure {statx,fstatat}(..., AT_EMPTY_PATH | ..., NULL, ...) behave as (..., AT_EMPTY_PATH | ..., "", ...)"
- Previous message: Thorsten Blum: "[RESEND PATCH] ext4: Annotate struct fname with __counted_by()"
- In reply to: Xi Ruoyao: "[PATCH 0/2] vfs: fstatat, statx: Consistently accept AT_EMPTY_PATH and NULL path"
- Next in thread: Xi Ruoyao: "[PATCH 2/2] vfs: Make sure {statx,fstatat}(..., AT_EMPTY_PATH | ..., NULL, ...) behave as (..., AT_EMPTY_PATH | ..., "", ...)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]