From 54ac471c83aff6b1e068eb8029c797dc68a76e89 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Wed, 23 May 2012 13:26:10 -0400 Subject: NFS: Add memory barriers to the nfs_client->cl_cons_state initialisation Ensure that a process that uses the nfs_client->cl_cons_state test for whether the initialisation process is finished does not read stale data. Signed-off-by: Trond Myklebust --- fs/nfs/idmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/nfs/idmap.c') diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index 861be75eb16..b5b86a05059 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c @@ -548,6 +548,7 @@ restart: /* Skip nfs_clients that failed to initialise */ if (clp->cl_cons_state < 0) continue; + smp_rmb(); if (clp->rpc_ops != &nfs_v4_clientops) continue; cl_dentry = clp->cl_idmap->idmap_pipe->dentry; -- cgit v1.2.3