[v3] Linux: add ST_NOSYMFOLLOW

Message ID 20230927223712.633536-1-kolyshkin@gmail.com
State Committed
Commit 9e4e896f0f5a19a16c1a77567463b013a0f4952d
Headers
Series [v3] Linux: add ST_NOSYMFOLLOW |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Testing passed

Commit Message

Kir Kolyshkin Sept. 27, 2023, 10:37 p.m. UTC
  Linux v5.10 added a mount option MS_NOSYMFOLLOW, which was added to
glibc in commit 0ca21427d950755b.

Add the corresponding statfs/statvfs flag bit, ST_NOSYMFOLLOW.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
---
 sysdeps/unix/sysv/linux/bits/statvfs.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Adhemerval Zanella Netto Sept. 28, 2023, 12:51 p.m. UTC | #1
On 27/09/23 19:37, Kir Kolyshkin wrote:
> Linux v5.10 added a mount option MS_NOSYMFOLLOW, which was added to
> glibc in commit 0ca21427d950755b.
> 
> Add the corresponding statfs/statvfs flag bit, ST_NOSYMFOLLOW.
> 
> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/unix/sysv/linux/bits/statvfs.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/bits/statvfs.h b/sysdeps/unix/sysv/linux/bits/statvfs.h
> index cf98460e00..ed965f287f 100644
> --- a/sysdeps/unix/sysv/linux/bits/statvfs.h
> +++ b/sysdeps/unix/sysv/linux/bits/statvfs.h
> @@ -105,7 +105,9 @@ enum
>  # define ST_NOATIME	ST_NOATIME
>    ST_NODIRATIME = 2048,		/* Do not update directory access times.  */
>  # define ST_NODIRATIME	ST_NODIRATIME
> -  ST_RELATIME = 4096		/* Update atime relative to mtime/ctime.  */
> +  ST_RELATIME = 4096,		/* Update atime relative to mtime/ctime.  */
>  # define ST_RELATIME	ST_RELATIME
> +  ST_NOSYMFOLLOW = 8192		/* Do not follow symlinks.  */
> +# define ST_NOSYMFOLLOW	ST_NOSYMFOLLOW
>  #endif	/* Use GNU.  */
>  };
  

Patch

diff --git a/sysdeps/unix/sysv/linux/bits/statvfs.h b/sysdeps/unix/sysv/linux/bits/statvfs.h
index cf98460e00..ed965f287f 100644
--- a/sysdeps/unix/sysv/linux/bits/statvfs.h
+++ b/sysdeps/unix/sysv/linux/bits/statvfs.h
@@ -105,7 +105,9 @@  enum
 # define ST_NOATIME	ST_NOATIME
   ST_NODIRATIME = 2048,		/* Do not update directory access times.  */
 # define ST_NODIRATIME	ST_NODIRATIME
-  ST_RELATIME = 4096		/* Update atime relative to mtime/ctime.  */
+  ST_RELATIME = 4096,		/* Update atime relative to mtime/ctime.  */
 # define ST_RELATIME	ST_RELATIME
+  ST_NOSYMFOLLOW = 8192		/* Do not follow symlinks.  */
+# define ST_NOSYMFOLLOW	ST_NOSYMFOLLOW
 #endif	/* Use GNU.  */
 };