Skip to contentSkip to conversation

fs/crypto/hooks.c: fix build with pre-4.6 gcc versions

PATCH Applied Eric Biggers 3 participants 5 messages Jan 19, 2018 – Feb 1, 2018 fscrypt: file system level encryption support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/crypto/hooks.c: fix build with pre-4.6 gcc versions

From: Eric Biggers <[email protected]>

gcc versions prior to 4.6 require an extra level of braces when using a designated initializer for a member in an anonymous struct or union. This caused a compile error with the 'struct qstr' initialization in __fscrypt_encrypt_symlink().

Fix it by using QSTR_INIT().

Fixes 76e81d6d5048 ("fscrypt: new helper functions for ->symlink()")
---
 fs/crypto/hooks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/crypto/hooks.c +1 -1
index 28f9f059571d..bec06490fb13 100644
@@ -158,7 +158,7 @@ int __fscrypt_encrypt_symlink(struct inode *inode, const char *target,
 			      unsigned int len, struct fscrypt_str *disk_link)
 {
 	int err;
-	struct qstr iname = { .name = target, .len = len };
+	struct qstr iname = QSTR_INIT(target, len);
 	struct fscrypt_symlink_data *sd;
 	unsigned int ciphertext_len;
 
Signature · 1 line
2.16.0.rc1.238.g530d649a79-goog
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Fri, 19 Jan 2018 13:45:24 -0800 Eric Biggers <[email protected]> wrote:

From: Eric Biggers <[email protected]>

gcc versions prior to 4.6 require an extra level of braces when using a designated initializer for a member in an anonymous struct or union. This caused a compile error with the 'struct qstr' initialization in __fscrypt_encrypt_symlink().

Quoted 5 lines

Fix it by using QSTR_INIT().

Fixes 76e81d6d5048 ("fscrypt: new helper functions for ->symlink()")
#2 lore raw
Quoted 9 lines · Andrew Morton
Quoted 7 lines · On Fri, 19 Jan 2018 13:45:24 -0800 Eric Biggers <[email protected]> wrote:

From: Eric Biggers <[email protected]>

gcc versions prior to 4.6 require an extra level of braces when using a designated initializer for a member in an anonymous struct or union. This caused a compile error with the 'struct qstr' initialization in __fscrypt_encrypt_symlink().

Quoted 7 lines
Quoted 5 lines

Fix it by using QSTR_INIT().

Fixes 76e81d6d5048 ("fscrypt: new helper functions for ->symlink()")

Ted, can you apply this to the fscrypt tree?

#3 lore raw
Quoted 12 lines · Eric Biggers
Quoted 11 lines · Andrew Morton
Quoted 9 lines · On Fri, 19 Jan 2018 13:45:24 -0800 Eric Biggers <[email protected]> wrote:

From: Eric Biggers <[email protected]>

gcc versions prior to 4.6 require an extra level of braces when using a designated initializer for a member in an anonymous struct or union. This caused a compile error with the 'struct qstr' initialization in __fscrypt_encrypt_symlink().

Fix it by using QSTR_INIT().

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Fixes 76e81d6d5048 ("fscrypt: new helper functions for ->symlink()")

Ted, can you apply this to the fscrypt tree?

Ping.

maintainer Applied
#4 lore raw
In reply to Eric Biggers
Quoted 7 lines · Eric Biggers

From: Eric Biggers <[email protected]>

gcc versions prior to 4.6 require an extra level of braces when using a designated initializer for a member in an anonymous struct or union. This caused a compile error with the 'struct qstr' initialization in __fscrypt_encrypt_symlink().

Quoted 5 lines

Fix it by using QSTR_INIT().

Fixes 76e81d6d5048 ("fscrypt: new helper functions for ->symlink()")

Thanks, applied.

- Ted