From patchwork Fri Jan 19 21:45:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10176013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4EB1F602B1 for ; Fri, 19 Jan 2018 21:47:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31DA8287BD for ; Fri, 19 Jan 2018 21:47:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 268A9287C3; Fri, 19 Jan 2018 21:47:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96757287BD for ; Fri, 19 Jan 2018 21:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756373AbeASVr0 (ORCPT ); Fri, 19 Jan 2018 16:47:26 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:46314 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756260AbeASVrZ (ORCPT ); Fri, 19 Jan 2018 16:47:25 -0500 Received: by mail-io0-f193.google.com with SMTP id f34so3640044ioi.13 for ; Fri, 19 Jan 2018 13:47:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EJ5o+PRwB47/mNPtOAl26qpCRFA2XMpxwtA7eTF3q3c=; b=KLpHK/ID/deF+EMVCJowtxyH8dbzHIm0YyYb89nscqaiPoRYrEUDddDrlf1OKw0w+W ZrKOzWM8yd4bnPlIr5WiJyiVvpYN7DBMWxv2yZ99s7uzYXji4DMuCQ0/wslOJArUO6OV qmvDeGHGe6SaVCk+b7A5Rw1+ANd6iMS5NY/xhf/Co/yTUotaeR3xCrOUk5n3U927piR9 yBKOTgzGZOEtsjCcQLTYwXhBdBACAIfHqBPZjByTx8XZY+hoPMi3ugUp2gXYgecHI6ij OBeUz9NXAFF27oOtK2q65r3ZNBlewTkX80gRhFT1kxcMGvRqAZN8JleEHon5xxBl5LMs kuUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EJ5o+PRwB47/mNPtOAl26qpCRFA2XMpxwtA7eTF3q3c=; b=W9w5h1LF7aJ41LmlhBQ+YRc4XpsSg0YwcIuR03T1i0SMKAn62RYfPrsgUG8Cxt8i7b oK5EwBHIx3sv436zbZqJImjuZwnb7gcQuT8HKNegl7yxo0BWHaWqOKZwp40DVC49k2kZ zLKJLqKC+Q44dMR+njIwGrXMd8RGIEvhNNcvQhUPh/cLa9rRbaVMAcJbyhqV4FofQRVL uShrSA1J1FjtvSBO1CTFtT8xQT8BG21LHIJu6m4AJHa9ptPNpg2FSIib3KKzi6+7xDpo 0GWAFhC9iHS1nE6x0Gj+bQI5beP92WYa3o2PGTR7oGZpfwaUpEuvUaHHcZywy21hhLLW vTGg== X-Gm-Message-State: AKwxyteOzdGY7R0APiSlFmGNItCjBayEgb8LdVpqd/l7HaxNgbPFrijF HZkQiJ/QzNi2dj68kUjslYQ4I7aV X-Google-Smtp-Source: ACJfBouJin5JkIFtMzX0qmR5bk2ORAjCbnHq/mKZX673StmRf7CS6/uJpGZvFp0PvLsAe/bZ86irvg== X-Received: by 10.107.136.201 with SMTP id s70mr27606382ioi.177.1516398444382; Fri, 19 Jan 2018 13:47:24 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id t84sm1177120iod.6.2018.01.19.13.47.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 13:47:23 -0800 (PST) From: Eric Biggers To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" Cc: Andrew Morton , Eric Biggers Subject: [PATCH] fs/crypto/hooks.c: fix build with pre-4.6 gcc versions Date: Fri, 19 Jan 2018 13:45:24 -0800 Message-Id: <20180119214524.222850-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.16.0.rc1.238.g530d649a79-goog Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers 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 Fixes: 76e81d6d5048 ("fscrypt: new helper functions for ->symlink()") Signed-off-by: Eric Biggers Tested-by: Andrew Morton --- fs/crypto/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/crypto/hooks.c b/fs/crypto/hooks.c index 28f9f059571d..bec06490fb13 100644 --- a/fs/crypto/hooks.c +++ b/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) { 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;