Skip to content

Commit 678edd0

Browse files
committed
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 <[email protected]>
1 parent 27a3ee3 commit 678edd0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/afs/inode.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ struct inode *afs_iget(struct super_block *sb, struct key *key,
327327
/* failure */
328328
bad_inode:
329329
#ifdef CONFIG_AFS_FSCACHE
330-
fscache_relinquish_cookie(vnode->cache, 0);
330+
fscache_relinquish_cookie(vnode->cache, ret == -ENOENT);
331331
vnode->cache = NULL;
332332
#endif
333333
iget_failed(inode);
@@ -511,7 +511,8 @@ void afs_evict_inode(struct inode *inode)
511511
}
512512

513513
#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));
515516
vnode->cache = NULL;
516517
#endif
517518

0 commit comments

Comments
 (0)