From dce807770035b3b6d06f6d9317a336cf21a7b26a Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 29 Dec 2003 05:49:29 -0800 Subject: [PATCH] [PATCH] statfs64 fix From: Andi Kleen It fixes the statfs64 emulation on x86-64. The problem is that x86-64 needs an __attribute__((aligned)) on the compat_statfs64 structure. The conclusion last time this was discussed was that the structure should be duplicated. Essentially it is the old shared structure copied to every user and x86-64 uses __attribute__((packed)). --- include/asm-generic/statfs.h | 14 ++++++++++++++ include/asm-ia64/statfs.h | 13 +++++++++++++ include/asm-mips/statfs.h | 14 ++++++++++++++ include/asm-parisc/statfs.h | 14 ++++++++++++++ include/asm-ppc64/statfs.h | 14 ++++++++++++++ include/asm-s390/statfs.h | 14 ++++++++++++++ include/asm-sparc64/statfs.h | 14 ++++++++++++++ include/asm-x86_64/statfs.h | 14 ++++++++++++++ include/linux/compat.h | 14 -------------- 9 files changed, 111 insertions(+), 14 deletions(-) diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h index fecaf8fd5c10d..1d01043e797d9 100644 --- a/include/asm-generic/statfs.h +++ b/include/asm-generic/statfs.h @@ -34,4 +34,18 @@ struct statfs64 { __u32 f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif diff --git a/include/asm-ia64/statfs.h b/include/asm-ia64/statfs.h index 053effc79ac93..f4fa9462842f8 100644 --- a/include/asm-ia64/statfs.h +++ b/include/asm-ia64/statfs.h @@ -43,5 +43,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +} __attribute__((packed)); #endif /* _ASM_IA64_STATFS_H */ diff --git a/include/asm-mips/statfs.h b/include/asm-mips/statfs.h index 58a8999eef316..ef15465abdf99 100644 --- a/include/asm-mips/statfs.h +++ b/include/asm-mips/statfs.h @@ -75,6 +75,20 @@ struct statfs64 { /* Same as struct statfs */ long f_spare[6]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ #endif /* _ASM_STATFS_H */ diff --git a/include/asm-parisc/statfs.h b/include/asm-parisc/statfs.h index e8c8169d5d7fa..a52d8f93f05ce 100644 --- a/include/asm-parisc/statfs.h +++ b/include/asm-parisc/statfs.h @@ -41,4 +41,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif diff --git a/include/asm-ppc64/statfs.h b/include/asm-ppc64/statfs.h index 7cce64bf7ee0e..3c985e5246a7b 100644 --- a/include/asm-ppc64/statfs.h +++ b/include/asm-ppc64/statfs.h @@ -44,4 +44,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif /* _PPC64_STATFS_H */ diff --git a/include/asm-s390/statfs.h b/include/asm-s390/statfs.h index f9edb541f99fb..099a45579190e 100644 --- a/include/asm-s390/statfs.h +++ b/include/asm-s390/statfs.h @@ -53,5 +53,19 @@ struct statfs64 { int f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif /* __s390x__ */ #endif diff --git a/include/asm-sparc64/statfs.h b/include/asm-sparc64/statfs.h index 5985f1901cfc8..185b6c481b24f 100644 --- a/include/asm-sparc64/statfs.h +++ b/include/asm-sparc64/statfs.h @@ -38,4 +38,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif diff --git a/include/asm-x86_64/statfs.h b/include/asm-x86_64/statfs.h index bb11240c22b8b..b3f4718af30b0 100644 --- a/include/asm-x86_64/statfs.h +++ b/include/asm-x86_64/statfs.h @@ -41,4 +41,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +} __attribute__((packed)); + #endif diff --git a/include/linux/compat.h b/include/linux/compat.h index 3e8e53bdd42e4..d9adcd5b77c05 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -76,20 +76,6 @@ struct compat_rusage { compat_long_t ru_nivcsw; }; -struct compat_statfs64 { - __u32 f_type; - __u32 f_bsize; - __u64 f_blocks; - __u64 f_bfree; - __u64 f_bavail; - __u64 f_files; - __u64 f_ffree; - __kernel_fsid_t f_fsid; - __u32 f_namelen; - __u32 f_frsize; - __u32 f_spare[5]; -}; - struct compat_dirent { u32 d_ino; compat_off_t d_off; -- 2.53.0