Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2022 19:38:40 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 221d908864dd - stable/13 - linux(4): Add AT_NO_AUTOMOUNT to statx.
Message-ID:  <202206171938.25HJceif015000@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=221d908864ddd39402707570dd70e66b07fadd43

commit 221d908864ddd39402707570dd70e66b07fadd43
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-03-25 14:54:23 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:33:43 +0000

    linux(4): Add AT_NO_AUTOMOUNT to statx.
    
    Specific to Linux AT_NO_AUTOMOUNT flag tells the kernel to not automount the
    terminal component of pathname if it is a directory that is an automount point.
    As it is the default for FreeBSD silencly ignore this flag.
    
    glibc-2.34 uses this flag in the stat64 system calls which is used by i386.
    
    Reviewed by:            trasz
    Differential revision:  https://reviews.freebsd.org/D31524
    MFC after:              2 weeks
    
    (cherry picked from commit ff39d74aa99a49749d1de26dc1f6b1e1bfebceb0)
---
 sys/compat/linux/linux_file.h  | 7 +++++++
 sys/compat/linux/linux_stats.c | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/sys/compat/linux/linux_file.h b/sys/compat/linux/linux_file.h
index e6a5bf0ce8a6..3f885f915411 100644
--- a/sys/compat/linux/linux_file.h
+++ b/sys/compat/linux/linux_file.h
@@ -36,6 +36,13 @@
 #define	LINUX_AT_EACCESS		0x200
 #define	LINUX_AT_REMOVEDIR		0x200
 #define	LINUX_AT_SYMLINK_FOLLOW		0x400
+#define	LINUX_AT_NO_AUTOMOUNT		0x800
+		/*
+		 * Specific to Linux AT_NO_AUTOMOUNT flag tells the kernel to
+		 * not automount the terminal component of pathname if it is a
+		 * directory that is an automount point. As FreeBSD does not
+		 * have such facility (automount), we can simply ignore this flag.
+		 */
 #define	LINUX_AT_EMPTY_PATH		0x1000
 
 /*
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index 9dc7686cb963..e01cb0c8d87a 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -774,7 +774,8 @@ linux_statx(struct thread *td, struct linux_statx_args *args)
 	int error, dirfd, flags, unsupported;
 	struct stat buf;
 
-	unsupported = args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH);
+	unsupported = args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW |
+	    LINUX_AT_EMPTY_PATH | LINUX_AT_NO_AUTOMOUNT);
 	if (unsupported != 0) {
 		linux_msg(td, "statx unsupported flags 0x%x", unsupported);
 		return (EINVAL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206171938.25HJceif015000>