aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayoutdev.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-26 14:32:56 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-29 15:58:35 -0400
commitacd65e5bc1986d0089efec3fe63e52ea0c406d6d (patch)
tree69f3ed1d96d708b4b927ed40228a4813c666b88a /fs/nfs/nfs4filelayoutdev.c
parent52b26a3e1bb3e065c32b3febdac1e1f117d88e15 (diff)
NFSv4.1: Ensure memory ordering between nfs4_ds_connect and nfs4_fl_prepare_ds
We need to ensure that the initialisation of the data server nfs_client structure in nfs4_ds_connect is correctly ordered w.r.t. the read of ds->ds_clp in nfs4_fl_prepare_ds. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayoutdev.c')
-rw-r--r--fs/nfs/nfs4filelayoutdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index cd3aef571c34..c7c295e556ed 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -185,6 +185,7 @@ nfs4_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds)
185 if (status) 185 if (status)
186 goto out_put; 186 goto out_put;
187 187
188 smp_wmb();
188 ds->ds_clp = clp; 189 ds->ds_clp = clp;
189 dprintk("%s [new] addr: %s\n", __func__, ds->ds_remotestr); 190 dprintk("%s [new] addr: %s\n", __func__, ds->ds_remotestr);
190out: 191out:
@@ -809,6 +810,7 @@ nfs4_fl_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx)
809 filelayout_mark_devid_invalid(devid); 810 filelayout_mark_devid_invalid(devid);
810 goto out; 811 goto out;
811 } 812 }
813 smp_rmb();
812 if (ds->ds_clp) 814 if (ds->ds_clp)
813 goto out_test_devid; 815 goto out_test_devid;
814 816