aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-07-24 12:26:34 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-07-24 12:51:49 -0400
commit45fcc7bca7004687e9ba28e08b3dfb6787a0b466 (patch)
treeed5f90b361769a5f664ae94cf262e420279790fa /fs/nfs/nfs4proc.c
parentdc05973b288a5226bb7e56afd6c2fa07560a907c (diff)
downloadlinux-stericsson-45fcc7bca7004687e9ba28e08b3dfb6787a0b466.tar.gz
pNFS: LAYOUTRETURN should only update the stateid if the layout is valid
If the layout was completely returned, then ignore the returned layout stateid. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ff416d0e24bc..dc50ba4d84ad 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8130,7 +8130,7 @@ static void nfs4_layoutreturn_release(void *calldata)
pnfs_mark_matching_lsegs_invalid(lo, &freeme, &lrp->args.range,
be32_to_cpu(lrp->args.stateid.seqid));
pnfs_mark_layout_returned_if_empty(lo);
- if (lrp->res.lrs_present)
+ if (lrp->res.lrs_present && pnfs_layout_is_valid(lo))
pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
pnfs_clear_layoutreturn_waitbit(lo);
spin_unlock(&lo->plh_inode->i_lock);