summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfscache.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-02-14 22:45:13 +0100
committerJ. Bruce Fields <bfields@redhat.com>2013-02-15 16:43:48 +0100
commit1ac8362977b9ec75779170ac3074c7b36ab19b82 (patch)
tree794de3ebb7819d97331faf40eb3e07e473f6f245 /fs/nfsd/nfscache.c
parentSUNRPC: move cache_detail->cache_request callback call to cache_read() (diff)
downloadlinux-1ac8362977b9ec75779170ac3074c7b36ab19b82.tar.xz
linux-1ac8362977b9ec75779170ac3074c7b36ab19b82.zip
nfsd: fix comments on nfsd_cache_lookup
Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfscache.c')
-rw-r--r--fs/nfsd/nfscache.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 40db57eb2b06..2f9c2d26a2b9 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -302,8 +302,10 @@ nfsd_cache_search(struct svc_rqst *rqstp, __wsum csum)
/*
* Try to find an entry matching the current call in the cache. When none
- * is found, we grab the oldest unlocked entry off the LRU list.
- * Note that no operation within the loop may sleep.
+ * is found, we try to grab the oldest expired entry off the LRU list. If
+ * a suitable one isn't there, then drop the cache_lock and allocate a
+ * new one, then search again in case one got inserted while this thread
+ * didn't hold the lock.
*/
int
nfsd_cache_lookup(struct svc_rqst *rqstp)
@@ -344,6 +346,7 @@ nfsd_cache_lookup(struct svc_rqst *rqstp)
}
}
+ /* Drop the lock and allocate a new entry */
spin_unlock(&cache_lock);
rp = nfsd_reply_cache_alloc();
if (!rp) {