]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: cache: ignore timestamp written to 'flush' file.
authorNeilBrown <neilb@suse.com>
Wed, 14 Feb 2018 01:15:06 +0000 (12:15 +1100)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 19 Mar 2018 20:38:12 +0000 (16:38 -0400)
commitc41edf23d52af9ee5916c2da611c0e75aa4d19d1
tree3a5eeb2a6b2f87e3d381022ae20e33856f89a97d
parent59ab9a528eb243dce4569a27469dc36fd24e4970
SUNRPC: cache: ignore timestamp written to 'flush' file.

The interface for flushing the sunrpc auth cache was poorly
designed and has caused problems a number of times.

The design is that you write a timestamp, and all entries
created before that time are discarded.
The most obvious problem is that this is not what people
actually want.  They want to just flush the whole cache.
The 1-second granularity can be a problem, as can the use
of wall-clock time.

A current problem is that code will write the current time to
this file - expecting it to clear everything - and if the
seconds number ticks over before this timestamp is checked,
the test "then >= now" fails, and a full flush isn't forced.

So lets just drop the subtleties and always flush the whole
cache.  The worst this could do is impose an extra cost
refilling it, but that would require someone to be using
non-standard tools.

We still report an error if the string written is not a number,
but we cause any valid number to flush the whole cache.

Reported-by: "Wang, Alan 1. (NSB - CN/Hangzhou)" <alan.1.wang@nokia-sbell.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/cache.c