]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
SUNRPC/cache: don't allow invalid entries to be flushed
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 27 Mar 2020 15:53:09 +0000 (11:53 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 27 Mar 2020 16:17:31 +0000 (12:17 -0400)
commit9a81ef42b238b28829a46ecf13c7aacb79b9b3ac
tree2437f937b6816aac5f79323b284194a0f5c5f3c8
parent69afd267982e733a555fede4e85fe30329ed0588
SUNRPC/cache: don't allow invalid entries to be flushed

Trond points out in commit 277f27e2f277 ("SUNRPC/cache: Allow
garbage collection of invalid cache entries") that we allow invalid
cache entries to persist indefinitely. That fix, however,
reintroduces the problem fixed by Kinglong Mee's commit d6fc8821c2d2
("SUNRPC/Cache: Always treat the invalid cache as unexpired"), where
an invalid cache entry is immediately removed by a flush before
mountd responds to it. The result is that the server thread that
should be waiting for mountd to fill in that entry instead gets an
-ETIMEDOUT return from cache_check(). Symptoms are the server
becoming unresponsive after a restart, reproduceable by running
pynfs 4.1 test REBT5.

Instead, take a compromise approach: allow invalid cache entries to
be removed after they expire, but not to be removed by a cache
flush.

Fixes: 277f27e2f277 ("SUNRPC/cache: Allow garbage collection ... ")
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/linux/sunrpc/cache.h