nfsd: fix comments on nfsd_cache_lookup
authorJeff Layton <jlayton@redhat.com>
Thu, 14 Feb 2013 21:45:13 +0000 (16:45 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 15 Feb 2013 15:43:48 +0000 (10:43 -0500)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfscache.c

index 40db57e..2f9c2d2 100644 (file)
@@ -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) {