rpdfs: use more clear mode comparisons
The cache mode comparisons in the block cache client were a bit sloppy.
The only helper function it has was using the langage of the server --
calling modes compatible when two clients can have those modes granted
concurrently.
That works for providing exclusion between handle acquisitions where
we're using the modes to describe rwlock exclusion. But it makes no
sense at all when deciding if the mode that we've been granted by the
protocol is sufficient to allow handle acquisitions with a given mode.
These was mostly correctly tested with raw comparisions but the revoke
mode tests were using the wrong comparison.
So we provide two much more clear comparisons functions that don't use
the compatible language. We have a function for concurrent handle
acquisitions and a function for whether the granted mode is sufficient
for local use with a given mode. We update all the mode test sites to
use one or the other.
This was noticed because the block cache was sending a confirm to a
revoke to null while blocks were dirty because write and null modes were
"compatible". The server would free the cache entry and then later
assert when a write with a confirm appeared for a block it wasn't
tracking.
Signed-off-by: Zach Brown <zab@zabbo.net>
1 file changed