diff options
author | David Howells <dhowells@redhat.com> | 2018-04-04 08:41:26 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-04-04 08:41:26 -0400 |
commit | 678edd09c24f8a47ed88b3e172e05cc4f611bfcd (patch) | |
tree | feb8f61451469fe176cf6bb1f1694e22f1faef1e | |
parent | 27a3ee3a0471abaacf0c2ab1397b188c7b693fcd (diff) |
afs: Be more aggressive in retiring cached vnodes
When relinquishing cookies, either due to iget failure or to inode
eviction, retire a cookie if we think the corresponding vnode got deleted
on the server rather than just letting it lie in the cache.
Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r-- | fs/afs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 42f83fd5a896..c942c79fc5f0 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c | |||
@@ -327,7 +327,7 @@ struct inode *afs_iget(struct super_block *sb, struct key *key, | |||
327 | /* failure */ | 327 | /* failure */ |
328 | bad_inode: | 328 | bad_inode: |
329 | #ifdef CONFIG_AFS_FSCACHE | 329 | #ifdef CONFIG_AFS_FSCACHE |
330 | fscache_relinquish_cookie(vnode->cache, 0); | 330 | fscache_relinquish_cookie(vnode->cache, ret == -ENOENT); |
331 | vnode->cache = NULL; | 331 | vnode->cache = NULL; |
332 | #endif | 332 | #endif |
333 | iget_failed(inode); | 333 | iget_failed(inode); |
@@ -511,7 +511,8 @@ void afs_evict_inode(struct inode *inode) | |||
511 | } | 511 | } |
512 | 512 | ||
513 | #ifdef CONFIG_AFS_FSCACHE | 513 | #ifdef CONFIG_AFS_FSCACHE |
514 | fscache_relinquish_cookie(vnode->cache, 0); | 514 | fscache_relinquish_cookie(vnode->cache, |
515 | test_bit(AFS_VNODE_DELETED, &vnode->flags)); | ||
515 | vnode->cache = NULL; | 516 | vnode->cache = NULL; |
516 | #endif | 517 | #endif |
517 | 518 | ||