summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorFred Isaman <fred.isaman@gmail.com>2016-10-18 13:39:51 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2018-05-31 15:03:11 -0400
commit30ae2412e90f0ae177da631e36537392d89a2ccd (patch)
tree53b80f8afab7dcd0a4956aba3244ac03e92c9d39 /fs/nfs/pnfs.c
parentc49b5209f99abe082d3d4cd94f0ad924baea34ed (diff)
downloadlinux-30ae2412e90f0ae177da631e36537392d89a2ccd.tar.bz2
pnfs: Fix manipulation of NFS_LAYOUT_FIRST_LAYOUTGET
The flag was not always being cleared after LAYOUTGET on OPEN. Signed-off-by: Fred Isaman <fred.isaman@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index a29fdea2db91..b0e42fd07cb1 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2129,13 +2129,11 @@ void pnfs_parse_lgopen(struct inode *ino, struct nfs4_layoutget *lgp,
lgp->args.inode = ino;
} else
lo = NFS_I(lgp->args.inode)->layout;
- pnfs_get_layout_hdr(lo);
if (read_seqcount_retry(&srv->nfs_client->cl_callback_count,
lgp->callback_count))
- goto out;
+ return;
lseg = pnfs_layout_process(lgp);
- atomic_dec(&lo->plh_outstanding);
if (IS_ERR(lseg)) {
/* ignore lseg, but would like to mark not to try lgopen */
/* clear some lo flags - first and fail ???? */
@@ -2144,9 +2142,19 @@ void pnfs_parse_lgopen(struct inode *ino, struct nfs4_layoutget *lgp,
pnfs_layout_clear_fail_bit(lo, pnfs_iomode_to_fail_bit(iomode));
pnfs_put_lseg(lseg);
}
-out:
- pnfs_clear_first_layoutget(lo);
- pnfs_put_layout_hdr(lo);
+}
+
+void nfs4_lgopen_release(struct nfs4_layoutget *lgp)
+{
+ if (lgp != NULL) {
+ struct inode *inode = lgp->args.inode;
+ if (inode) {
+ struct pnfs_layout_hdr *lo = NFS_I(inode)->layout;
+ atomic_dec(&lo->plh_outstanding);
+ pnfs_clear_first_layoutget(lo);
+ }
+ pnfs_layoutget_free(lgp);
+ }
}
struct pnfs_layout_segment *