From patchwork Mon Oct 17 10:14:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9378871 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 A345260780 for ; Mon, 17 Oct 2016 10:14:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 957B32913D for ; Mon, 17 Oct 2016 10:14:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89F2C29148; Mon, 17 Oct 2016 10:14:50 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 60BCC2913D for ; Mon, 17 Oct 2016 10:14:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964798AbcJQKOq (ORCPT ); Mon, 17 Oct 2016 06:14:46 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:55168 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933955AbcJQKOq (ORCPT ); Mon, 17 Oct 2016 06:14:46 -0400 Received: from ayla.of.borg ([84.193.137.253]) by andre.telenet-ops.be with bizsmtp id waEi1t00N5UCtCs01aEiVq; Mon, 17 Oct 2016 12:14:44 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1bw4wM-0006P7-Ec; Mon, 17 Oct 2016 12:14:42 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1bw4wQ-0001Tz-3W; Mon, 17 Oct 2016 12:14:46 +0200 From: Geert Uytterhoeven To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] NFSv4: Fix anonymous member initializer in update_open_stateid() Date: Mon, 17 Oct 2016 12:14:44 +0200 Message-Id: <1476699284-5666-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With gcc 3.4/4.1/4.2/4.4/4.6/4.8: fs/nfs/nfs4proc.c: In function ‘update_open_stateid’: fs/nfs/nfs4proc.c:1548: warning: missing braces around initializer fs/nfs/nfs4proc.c:1548: warning: (near initialization for ‘freeme.’) Add the missing braces to fix this. Fixes: 1393d9612ba02d8b ("NFSv4: Fix a race when updating an open_stateid") Signed-off-by: Geert Uytterhoeven --- See also commit e0714ec4f9efe7b8 ("nfs: fix anonymous member initializer build failure with older compilers"). My first thought it was an old 4.x thingy, but surprisingly this warning is also generated by gcc 4.8.4. --- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index ad917bd72b38c3b2..6fa34095783239da 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1545,7 +1545,7 @@ static int update_open_stateid(struct nfs4_state *state, struct nfs_client *clp = server->nfs_client; struct nfs_inode *nfsi = NFS_I(state->inode); struct nfs_delegation *deleg_cur; - nfs4_stateid freeme = {0}; + nfs4_stateid freeme = { { { 0 } } }; int ret = 0; fmode &= (FMODE_READ|FMODE_WRITE);