[PATCH 1/2] vfs: support fstatat(..., NULL, AT_EMPTY_PATH | AT_NO_AUTOMOUNT, ...)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux