summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorPeng Tao <tao.peng@primarydata.com>2015-08-21 12:49:44 +0800
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-08-25 14:40:06 -0400
commit3976143b063e3c42fe5471d87860f6ae118e0eee (patch)
treef482472e997dca2964deaca282292eee897d2c63 /fs/nfs/pnfs.c
parent249b2eef647f97164b8bb61f2d9282f227a17992 (diff)
downloadlinux-3976143b063e3c42fe5471d87860f6ae118e0eee.tar.bz2
NFS41: remove NFS_LAYOUT_ROC flag
If we return delegation before closing, we fail to do roc check during close because NFS_LAYOUT_ROC is cleared by delegreturn and it causes layouts to be still hanging around after delegreturn + close, which is a voilation against protocol. Signed-off-by: Peng Tao <tao.peng@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index cf90eeda9d71..247c5a5d2d6b 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1068,8 +1068,7 @@ bool pnfs_roc(struct inode *ino)
spin_lock(&ino->i_lock);
lo = nfsi->layout;
- if (!lo || !test_and_clear_bit(NFS_LAYOUT_ROC, &lo->plh_flags) ||
- test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags))
+ if (!lo || test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags))
goto out_noroc;
/* no roc if we hold a delegation */
@@ -1617,10 +1616,8 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
pnfs_get_lseg(lseg);
pnfs_layout_insert_lseg(lo, lseg);
- if (res->return_on_close) {
+ if (res->return_on_close)
set_bit(NFS_LSEG_ROC, &lseg->pls_flags);
- set_bit(NFS_LAYOUT_ROC, &lo->plh_flags);
- }
spin_unlock(&ino->i_lock);
pnfs_free_lseg_list(&free_me);