From 35339580aaed1d0feed5eb25593f3704d12b5182 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 14 Feb 2013 16:45:13 -0500 Subject: [PATCH] --- yaml --- r: 359739 b: refs/heads/master c: 1ac8362977b9ec75779170ac3074c7b36ab19b82 h: refs/heads/master i: 359737: ed9a0ba11216bddd4057d4a3d231b0caaf58b0d0 359735: af8d1e70da4acef1e4c82493be2b7fea591a2431 v: v3 --- [refs] | 2 +- trunk/fs/nfsd/nfscache.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 25ca2055c36d..470204d2aa8f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d94af6dea9cd680fb795dbc409a7360f1c63dc34 +refs/heads/master: 1ac8362977b9ec75779170ac3074c7b36ab19b82 diff --git a/trunk/fs/nfsd/nfscache.c b/trunk/fs/nfsd/nfscache.c index 40db57eb2b06..2f9c2d26a2b9 100644 --- a/trunk/fs/nfsd/nfscache.c +++ b/trunk/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) {