diff --git a/fs/namei.c b/fs/namei.c index 914178cdbe94b45c1c14040733eb67cdbcf4bc55..d604f6b3bcc3162f9cec2900e46c94a21d9adc9f 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -39,7 +39,6 @@ #include #include #include -#include #include "internal.h" #include "mount.h" @@ -131,7 +130,6 @@ getname_flags(const char __user *filename, int flags, int *empty) struct filename *result; char *kname; int len; - BUILD_BUG_ON(offsetof(struct filename, iname) % sizeof(long) != 0); result = audit_reusename(filename); if (result) diff --git a/include/linux/fs.h b/include/linux/fs.h index 08f26046233ee621c4beed40344bde90f22b33cc..1a775aa3e349313b824c7554665fa976966a1d6e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include #include @@ -2493,6 +2495,7 @@ struct filename { struct audit_names *aname; const char iname[]; }; +static_assert(offsetof(struct filename, iname) % sizeof(long) == 0); extern long vfs_truncate(const struct path *, loff_t); extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,