From 7e5f466f5bfb0b4ab0d991cded99aa433f2b6aff Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sun, 6 May 2012 19:34:17 -0400 Subject: [PATCH] --- yaml --- r: 308591 b: refs/heads/master c: c57d1bc5e043dbb5ba82ded07003d71a8033d899 h: refs/heads/master i: 308589: f2b168c7f49dc41cd5c725e7c3955ff3d4c1a4b1 308587: 07b30d9a274f8427ba71276df4b0675fb4e30756 308583: 3925221a8528d2e780cde8d0a941e11c483f2726 308575: 153edc0e4bb1b081def2aa62d824c591adc990cf v: v3 --- [refs] | 2 +- trunk/fs/nfs/delegation.c | 6 +++++- trunk/fs/nfs/delegation.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index e177215584d9..21ccce365db4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 14546c337588370dced50dcaf43398939be9829e +refs/heads/master: c57d1bc5e043dbb5ba82ded07003d71a8033d899 diff --git a/trunk/fs/nfs/delegation.c b/trunk/fs/nfs/delegation.c index 89af1d269274..a19cb5ad6b13 100644 --- a/trunk/fs/nfs/delegation.c +++ b/trunk/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); } } diff --git a/trunk/fs/nfs/delegation.h b/trunk/fs/nfs/delegation.h index cd6a7a8dadae..72709c4193fa 100644 --- a/trunk/fs/nfs/delegation.h +++ b/trunk/fs/nfs/delegation.h @@ -66,6 +66,7 @@ static inline int nfs_have_delegation(struct inode *inode, fmode_t flags) static inline int nfs_inode_return_delegation(struct inode *inode) { + nfs_wb_all(inode); return 0; } #endif