From e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 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=UTF-8 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 93b717fd81bf ("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 5075592df145..9679f4749364 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);