s390/uapi: cover statfs padding by growing f_spare
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 4 May 2023 14:40:21 +0000 (16:40 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Wed, 17 May 2023 13:20:17 +0000 (15:20 +0200)
pahole says:

struct compat_statfs64 {
...
u32 f_spare[4]; /*    68    16 */
/* size: 88, cachelines: 1, members: 12 */
/* padding: 4 */

struct statfs {
...
unsigned int f_spare[4]; /*    68    16 */
/* size: 88, cachelines: 1, members: 12 */
/* padding: 4 */

struct statfs64 {
...
unsigned int f_spare[4]; /*    68    16 */
/* size: 88, cachelines: 1, members: 12 */
/* padding: 4 */

One has to keep the existence of padding in mind when working with
these structs. Grow f_spare arrays to 5 in order to simplify things.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20230504144021.808932-3-iii@linux.ibm.com
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/include/asm/compat.h
arch/s390/include/uapi/asm/statfs.h

index a386070f1d5653a97bf2aa075b21c23e83eac436..3cb9d813f022b9b8e565bca04f9ec1e805452e2f 100644 (file)
@@ -112,7 +112,7 @@ struct compat_statfs64 {
        u32             f_namelen;
        u32             f_frsize;
        u32             f_flags;
-       u32             f_spare[4];
+       u32             f_spare[5];
 };
 
 /*
index 72604f7792c33642aed1907bb0a69effd8b06991..f85b50723dd355f04a66e3ef5ac07bf89de0c6ff 100644 (file)
@@ -30,7 +30,7 @@ struct statfs {
        unsigned int    f_namelen;
        unsigned int    f_frsize;
        unsigned int    f_flags;
-       unsigned int    f_spare[4];
+       unsigned int    f_spare[5];
 };
 
 struct statfs64 {
@@ -45,7 +45,7 @@ struct statfs64 {
        unsigned int    f_namelen;
        unsigned int    f_frsize;
        unsigned int    f_flags;
-       unsigned int    f_spare[4];
+       unsigned int    f_spare[5];
 };
 
 #endif