summaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-07 01:34:17 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-08 18:53:21 +0200
commitc57d1bc5e043dbb5ba82ded07003d71a8033d899 (patch)
treed56f455d3b2fbe8d7b52ac047f299bba67bef138 /fs/nfs/delegation.c
parentNFS: Don't do a full flush to disk on close() if we hold a delegation (diff)
downloadlinux-c57d1bc5e043dbb5ba82ded07003d71a8033d899.tar.xz
linux-c57d1bc5e043dbb5ba82ded07003d71a8033d899.zip
NFS: nfs_inode_return_delegation() should always flush dirty data
The assumption is that if you are in a situation where you need to return the delegation, then you should probably stop caching the data anyway. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 89af1d269274..a19cb5ad6b13 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -380,6 +380,10 @@ void nfs_inode_return_delegation_noreclaim(struct inode *inode)
* nfs_inode_return_delegation - synchronously return a delegation
* @inode: inode to process
*
+ * This routine will always flush any dirty data to disk on the
+ * assumption that if we need to return the delegation, then
+ * we should stop caching.
+ *
* Returns zero on success, or a negative errno value.
*/
int nfs_inode_return_delegation(struct inode *inode)
@@ -389,10 +393,10 @@ int nfs_inode_return_delegation(struct inode *inode)
struct nfs_delegation *delegation;
int err = 0;
+ nfs_wb_all(inode);
if (rcu_access_pointer(nfsi->delegation) != NULL) {
delegation = nfs_detach_delegation(nfsi, server);
if (delegation != NULL) {
- nfs_wb_all(inode);
err = __nfs_inode_return_delegation(inode, delegation, 1);
}
}