All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: torvalds@linux-foundation.org
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	dhowells@redhat.com, linux-cachefs@redhat.com,
	linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org
Subject: [PATCH 03/12] afs: Be more aggressive in retiring cached vnodes
Date: Wed, 04 Apr 2018 23:07:02 +0100	[thread overview]
Message-ID: <152287962276.14760.9298205710182682407.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <152287959470.14760.10350886166577848180.stgit@warthog.procyon.org.uk>

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>
---

 fs/afs/inode.c |    5 +++--
 1 file 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,
 	/* failure */
 bad_inode:
 #ifdef CONFIG_AFS_FSCACHE
-	fscache_relinquish_cookie(vnode->cache, 0);
+	fscache_relinquish_cookie(vnode->cache, ret == -ENOENT);
 	vnode->cache = NULL;
 #endif
 	iget_failed(inode);
@@ -511,7 +511,8 @@ void afs_evict_inode(struct inode *inode)
 	}
 
 #ifdef CONFIG_AFS_FSCACHE
-	fscache_relinquish_cookie(vnode->cache, 0);
+	fscache_relinquish_cookie(vnode->cache,
+				  test_bit(AFS_VNODE_DELETED, &vnode->flags));
 	vnode->cache = NULL;
 #endif
 

  parent reply	other threads:[~2018-04-04 22:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04 22:06 [PATCH net-next 00/12] fscache: Fixes, traces and development David Howells
2018-04-04 22:06 ` [PATCH 01/12] afs: Invalidate cache on server data change David Howells
2018-04-04 22:06 ` [PATCH 02/12] afs: Use the vnode ID uniquifier in the cache key not the aux data David Howells
2018-04-04 22:07 ` David Howells [this message]
2018-04-04 22:07 ` [PATCH 04/12] fscache, cachefiles: Fix checker warnings David Howells
2018-04-04 22:07 ` [PATCH 05/12] fscache: Pass the correct cancelled indications to fscache_op_complete() David Howells
2018-04-04 22:07 ` [PATCH 06/12] fscache: Detect multiple relinquishment of a cookie David Howells
2018-04-04 22:53   ` Linus Torvalds
2018-04-04 22:07 ` [PATCH 07/12] fscache: Fix hanging wait on page discarded by writeback David Howells
2018-04-04 22:07 ` [PATCH 08/12] fscache: Add tracepoints David Howells
2018-04-04 22:07 ` [PATCH 09/12] fscache: Add more tracepoints David Howells
2018-04-04 22:07 ` [PATCH 10/12] fscache: Attach the index key and aux data to the cookie David Howells
2018-04-04 22:07 ` [PATCH 11/12] fscache: Pass object size in rather than calling back for it David Howells
2018-04-04 22:08 ` [PATCH 12/12] fscache: Maintain a catalogue of allocated cookies David Howells
2018-04-04 22:10 ` [PATCH net-next 00/12] fscache: Fixes, traces and development David Howells
2018-04-06 14:44 ` David Howells
2018-04-06 18:21   ` Linus Torvalds
2018-04-06 18:32     ` Linus Torvalds
2018-04-06 21:02       ` Matthew Wilcox
2018-04-06 21:16         ` Linus Torvalds
2018-04-06 19:28     ` David Howells
2018-04-06 19:40       ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=152287962276.14760.9298205710182682407.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.