summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-08-04 21:57:13 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-08-12 20:56:19 +0200
commit5c4a79fb2b1cd80cb58986f6acf402721901c545 (patch)
treecd5c7e472b425d297910b7bc0797e649d9faa662 /fs/nfs/pnfs.c
parentNFSv4.1/pnfs: Fix serialisation of layout return and layoutget (diff)
downloadlinux-5c4a79fb2b1cd80cb58986f6acf402721901c545.tar.xz
linux-5c4a79fb2b1cd80cb58986f6acf402721901c545.zip
NFSv4.1/pnfs: Don't prevent layoutgets when doing return-on-close
If there is an outstanding return-on-close, then we just want new layoutget requests to wait rather than fail. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index e3a47ee15474..8c5f9f59efbb 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1105,7 +1105,9 @@ bool pnfs_roc(struct inode *ino)
}
if (!found)
goto out_noroc;
- lo->plh_block_lgets++;
+ if (test_and_set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags))
+ goto out_noroc;
+ lo->plh_return_iomode = IOMODE_ANY;
pnfs_get_layout_hdr(lo); /* matched in pnfs_roc_release */
spin_unlock(&ino->i_lock);
pnfs_free_lseg_list(&tmp_list);
@@ -1133,7 +1135,7 @@ void pnfs_roc_release(struct inode *ino)
spin_lock(&ino->i_lock);
lo = NFS_I(ino)->layout;
- lo->plh_block_lgets--;
+ pnfs_clear_layoutreturn_waitbit(lo);
if (atomic_dec_and_test(&lo->plh_refcount)) {
pnfs_detach_layout_hdr(lo);
spin_unlock(&ino->i_lock);