Skip to content

Commit

Permalink
nfs: always update creds in mirror, even when we have an already conn…
Browse files Browse the repository at this point in the history
…ected ds

A ds can be associated with more than one mirror, but we currently skip
setting a mirror's credentials if we find that it's already set up with
a connected client.

The upshot is that we can end up sending DS writes with MDS credentials
instead of properly setting them up. Fix nfs4_ff_layout_prepare_ds to
always verify that the mirror's credentials are set up, even when we
have a DS that's already connected.

Reported-by: Tom Haynes <thomas.haynes@primarydata.com>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Jeff Layton authored and Trond Myklebust committed Jun 25, 2015
1 parent a24221d commit 0c8315d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/nfs/flexfilelayout/flexfilelayoutdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx,
/* matching smp_wmb() in _nfs4_pnfs_v3/4_ds_connect */
smp_rmb();
if (ds->ds_clp)
goto out;
goto out_update_creds;

flavor = nfs4_ff_layout_choose_authflavor(mirror);

Expand Down Expand Up @@ -431,7 +431,7 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx,
}
}
}

out_update_creds:
if (ff_layout_update_mirror_cred(mirror, ds))
ds = NULL;
out:
Expand Down

0 comments on commit 0c8315d

Please sign in to comment.