소스 검색

fscrypt: fix build with pre-4.6 gcc versions

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().

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Fixes: 76e81d6d5048 ("fscrypt: new helper functions for ->symlink()")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Biggers 7 년 전
부모
커밋
0b1dfa4cc6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      fs/crypto/hooks.c

+ 1 - 1
fs/crypto/hooks.c

@@ -158,7 +158,7 @@ int __fscrypt_encrypt_symlink(struct inode *inode, const char *target,
 			      unsigned int len, struct fscrypt_str *disk_link)
 			      unsigned int len, struct fscrypt_str *disk_link)
 {
 {
 	int err;
 	int err;
-	struct qstr iname = { .name = target, .len = len };
+	struct qstr iname = QSTR_INIT(target, len);
 	struct fscrypt_symlink_data *sd;
 	struct fscrypt_symlink_data *sd;
 	unsigned int ciphertext_len;
 	unsigned int ciphertext_len;