From 31ee2733c53e3a779eebc860bc5b5f779ff2e7df Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 27 May 2016 17:20:27 -0700 Subject: [PATCH] nfs: fix anonymous member initializer build failure with older compilers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Older versions of gcc don't understand named initializers inside a anonymous structure or union member. It can be worked around by adding the bracin gin the initializer for the anonymous member. Without this, gcc 4.4.4 will fail the build with CC fs/nfs/nfs4state.o fs/nfs/nfs4state.c:69: error: unknown field ‘data’ specified in initializer fs/nfs/nfs4state.c:69: warning: missing braces around initializer fs/nfs/nfs4state.c:69: warning: (near initialization for ‘zero_stateid..data’) make[2]: *** [fs/nfs/nfs4state.o] Error 1 introduced in commit 5243d90c2c7f ("NFSv4: Label stateids with the type") Reported-and-tested-by: Boris Ostrovsky Cc: Anna Schumaker Cc: Trond Myklebust Signed-off-by: Linus Torvalds --- fs/nfs/nfs4state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 5075592df145a..9679f47493640 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -66,7 +66,7 @@ #define OPENOWNER_POOL_SIZE 8 const nfs4_stateid zero_stateid = { - .data = { 0 }, + { .data = { 0 } }, .type = NFS4_SPECIAL_STATEID_TYPE, }; static DEFINE_MUTEX(nfs_clid_init_mutex); -- 2.39.5