diff options
author | Jeff Layton <jlayton@poochiereds.net> | 2015-06-24 12:10:24 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-06-25 19:35:21 -0400 |
commit | 0c8315dd56577445dd1afe6b9cfa06b7efdf2f82 (patch) | |
tree | cb58025cee142c158326d6c67dedb4ec9b63e32a /fs/nfs/flexfilelayout/flexfilelayoutdev.c | |
parent | a24221dca1868101c9b4b5adde4a6a5b1a3a64a7 (diff) |
nfs: always update creds in mirror, even when we have an already connected 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>
Diffstat (limited to 'fs/nfs/flexfilelayout/flexfilelayoutdev.c')
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayoutdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c index c19b9a88f748..f13e1969eedd 100644 --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c | |||
@@ -387,7 +387,7 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx, | |||
387 | /* matching smp_wmb() in _nfs4_pnfs_v3/4_ds_connect */ | 387 | /* matching smp_wmb() in _nfs4_pnfs_v3/4_ds_connect */ |
388 | smp_rmb(); | 388 | smp_rmb(); |
389 | if (ds->ds_clp) | 389 | if (ds->ds_clp) |
390 | goto out; | 390 | goto out_update_creds; |
391 | 391 | ||
392 | flavor = nfs4_ff_layout_choose_authflavor(mirror); | 392 | flavor = nfs4_ff_layout_choose_authflavor(mirror); |
393 | 393 | ||
@@ -431,7 +431,7 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx, | |||
431 | } | 431 | } |
432 | } | 432 | } |
433 | } | 433 | } |
434 | 434 | out_update_creds: | |
435 | if (ff_layout_update_mirror_cred(mirror, ds)) | 435 | if (ff_layout_update_mirror_cred(mirror, ds)) |
436 | ds = NULL; | 436 | ds = NULL; |
437 | out: | 437 | out: |