Commit acd65e5b authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 52b26a3e
...@@ -185,6 +185,7 @@ nfs4_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds) ...@@ -185,6 +185,7 @@ nfs4_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds)
if (status) if (status)
goto out_put; goto out_put;
smp_wmb();
ds->ds_clp = clp; ds->ds_clp = clp;
dprintk("%s [new] addr: %s\n", __func__, ds->ds_remotestr); dprintk("%s [new] addr: %s\n", __func__, ds->ds_remotestr);
out: out:
...@@ -809,6 +810,7 @@ nfs4_fl_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx) ...@@ -809,6 +810,7 @@ nfs4_fl_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx)
filelayout_mark_devid_invalid(devid); filelayout_mark_devid_invalid(devid);
goto out; goto out;
} }
smp_rmb();
if (ds->ds_clp) if (ds->ds_clp)
goto out_test_devid; goto out_test_devid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment