diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-06 19:34:17 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-08 12:53:21 -0400 |
commit | c57d1bc5e043dbb5ba82ded07003d71a8033d899 (patch) | |
tree | d56f455d3b2fbe8d7b52ac047f299bba67bef138 | |
parent | 14546c337588370dced50dcaf43398939be9829e (diff) |
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>
-rw-r--r-- | fs/nfs/delegation.c | 6 | ||||
-rw-r--r-- | fs/nfs/delegation.h | 1 |
2 files changed, 6 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) | |||
380 | * nfs_inode_return_delegation - synchronously return a delegation | 380 | * nfs_inode_return_delegation - synchronously return a delegation |
381 | * @inode: inode to process | 381 | * @inode: inode to process |
382 | * | 382 | * |
383 | * This routine will always flush any dirty data to disk on the | ||
384 | * assumption that if we need to return the delegation, then | ||
385 | * we should stop caching. | ||
386 | * | ||
383 | * Returns zero on success, or a negative errno value. | 387 | * Returns zero on success, or a negative errno value. |
384 | */ | 388 | */ |
385 | int nfs_inode_return_delegation(struct inode *inode) | 389 | int nfs_inode_return_delegation(struct inode *inode) |
@@ -389,10 +393,10 @@ int nfs_inode_return_delegation(struct inode *inode) | |||
389 | struct nfs_delegation *delegation; | 393 | struct nfs_delegation *delegation; |
390 | int err = 0; | 394 | int err = 0; |
391 | 395 | ||
396 | nfs_wb_all(inode); | ||
392 | if (rcu_access_pointer(nfsi->delegation) != NULL) { | 397 | if (rcu_access_pointer(nfsi->delegation) != NULL) { |
393 | delegation = nfs_detach_delegation(nfsi, server); | 398 | delegation = nfs_detach_delegation(nfsi, server); |
394 | if (delegation != NULL) { | 399 | if (delegation != NULL) { |
395 | nfs_wb_all(inode); | ||
396 | err = __nfs_inode_return_delegation(inode, delegation, 1); | 400 | err = __nfs_inode_return_delegation(inode, delegation, 1); |
397 | } | 401 | } |
398 | } | 402 | } |
diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h index cd6a7a8dadae..72709c4193fa 100644 --- a/fs/nfs/delegation.h +++ b/fs/nfs/delegation.h | |||
@@ -66,6 +66,7 @@ static inline int nfs_have_delegation(struct inode *inode, fmode_t flags) | |||
66 | 66 | ||
67 | static inline int nfs_inode_return_delegation(struct inode *inode) | 67 | static inline int nfs_inode_return_delegation(struct inode *inode) |
68 | { | 68 | { |
69 | nfs_wb_all(inode); | ||
69 | return 0; | 70 | return 0; |
70 | } | 71 | } |
71 | #endif | 72 | #endif |