[PATCH 2/2] linux: statvfs: allocate spare for f_type

Florian Weimer fweimer@redhat.com
Mon Jun 26 13:15:29 GMT 2023


* наб via Libc-alpha:

> diff --git a/sysdeps/unix/sysv/linux/bits/statvfs.h b/sysdeps/unix/sysv/linux/bits/statvfs.h
> index 8dfb5ce761..cf98460e00 100644
> --- a/sysdeps/unix/sysv/linux/bits/statvfs.h
> +++ b/sysdeps/unix/sysv/linux/bits/statvfs.h
> @@ -51,7 +51,8 @@ struct statvfs
>  #endif
>      unsigned long int f_flag;
>      unsigned long int f_namemax;
> -    int __f_spare[6];
> +    unsigned int f_type;
> +    int __f_spare[5];
>    };
>  
>  #ifdef __USE_LARGEFILE64
> @@ -71,7 +72,8 @@ struct statvfs64
>  #endif
>      unsigned long int f_flag;
>      unsigned long int f_namemax;
> -    int __f_spare[6];
> +    unsigned int f_type;
> +    int __f_spare[5];
>    };
>  #endif

I think the caller can check for f_type being zero to check if it has
been written by glibc, so this does not require a new symbol version.
The previous already initializes __f_spare to zero, and none of the
magic values in <linux/magic.h> are zero.

This should perhaps have a NEWS entry, though, and a test case.

Thanks,
Florian



More information about the Libc-alpha mailing list