+Cc linux-fscrypt On Thu, Jan 18, 2018 at 03:51:15PM -0800, akpm@xxxxxxxxxxxxxxxxxxxx wrote: > ------------------------------------------------------ > From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > Subject: fs/crypto/hooks.c: fix build with gcc-4.4.4 > > gcc-4.4.4 has issues with anon union initializers. Work around this. > > fs/crypto/hooks.c: In function '__fscrypt_encrypt_symlink': > fs/crypto/hooks.c:161: error: unknown field 'len' specified in initializer > fs/crypto/hooks.c:161: warning: excess elements in struct initializer > fs/crypto/hooks.c:161: warning: (near initialization for 'iname') > > Fixes: 76e81d6d50 ("fscrypt: new helper functions for ->symlink()") > Cc: Eric Biggers <ebiggers@xxxxxxxxxx> > Cc: Theodore Ts'o <tytso@xxxxxxx> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > --- > > fs/crypto/hooks.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff -puN fs/crypto/hooks.c~fs-crypto-hooksc-fix-build-with-gcc-444 fs/crypto/hooks.c > --- a/fs/crypto/hooks.c~fs-crypto-hooksc-fix-build-with-gcc-444 > +++ a/fs/crypto/hooks.c > @@ -158,7 +158,7 @@ int __fscrypt_encrypt_symlink(struct ino > unsigned int len, struct fscrypt_str *disk_link) > { > int err; > - struct qstr iname = { .name = target, .len = len }; > + struct qstr iname = { { .hash_len = len, }, .name = target, }; > struct fscrypt_symlink_data *sd; > unsigned int ciphertext_len; > Thanks for finding this -- sorry for the trouble! But I think it should really use QSTR_INIT(), since that's what almost everywhere else uses to create a 'struct qstr': struct qstr iname = QSTR_INIT(target, len); Ted, can you take the QSTR_INIT() fix into the fscrypt tree? Maybe folded into "fscrypt: new helper functions for ->symlink()"? Or separate is okay too. Eric -- To unsubscribe from this list: send the line "unsubscribe linux-fscrypt" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |