diff options
author | NeilBrown <neilb@suse.de> | 2013-06-13 04:53:42 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-07-01 23:53:28 +0200 |
commit | 0bebc633f1428163c9659fd16b34c745e60a0757 (patch) | |
tree | 4534e9fe01086a6b9a860b2654d102ad4515e052 /net/sunrpc | |
parent | net/sunrpc: xpt_auth_cache should be ignored when expired. (diff) | |
download | linux-0bebc633f1428163c9659fd16b34c745e60a0757.tar.xz linux-0bebc633f1428163c9659fd16b34c745e60a0757.zip |
sunrpc: Don't schedule an upcall on a replaced cache entry.
When a cache entry is replaced, the "expiry_time" get set to
zero by a call to "cache_fresh_locked(..., 0)" at the end of
"sunrpc_cache_update".
This low expiry time makes cache_check() think that the 'refresh_age'
is negative, so the 'age' is comparatively large and a refresh is
triggered.
However refreshing a replaced entry it pointless, it cannot achieve
anything useful.
So teach cache_check to ignore a low refresh_age when expiry_time
is zero.
Reported-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/cache.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 5478a015ab00..49eb37010aa3 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -262,7 +262,8 @@ int cache_check(struct cache_detail *detail, if (rqstp == NULL) { if (rv == -EAGAIN) rv = -ENOENT; - } else if (rv == -EAGAIN || age > refresh_age/2) { + } else if (rv == -EAGAIN || + (h->expiry_time != 0 && age > refresh_age/2)) { dprintk("RPC: Want update, refage=%ld, age=%ld\n", refresh_age, age); if (!test_and_set_bit(CACHE_PENDING, &h->flags)) { |