Skip to contentSkip to conversation

NFSv4: Fix anonymous member initializer in update_open_stateid()

PATCH New Geert Uytterhoeven 1 participant 1 message Oct 17, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFSv4: Fix anonymous member initializer in update_open_stateid()

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.<anonymous>’)

Add the missing braces to fix this.

Fixes 1393d9612ba02d8b ("NFSv4: Fix a race when updating an open_stateid")

---
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(-)
fs/nfs/nfs4proc.c +1 -1
index ad917bd72b38c3b2..6fa34095783239da 100644
@@ -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);
Signature · 1 line
1.9.1