afs: Skip IsDCacheSizeOK for CDirty/VDIR 47/13747/2
authorAndrew Deason <adeason@sinenomine.net>
Mon, 29 Jul 2019 23:17:21 +0000 (18:17 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 2 Aug 2019 15:42:02 +0000 (11:42 -0400)
commite6b97b337bc97fdb1c8e4f1a0572c62dfc82d979
tree3fe96c49fb85475c51f5e124c8896b30e8820ab1
parentd6262c3f391e4176bec207fd0e8d4d6091a7f4e2
afs: Skip IsDCacheSizeOK for CDirty/VDIR

IsDCacheSizeOK currently can incorrectly flag a dcache as corrupted,
since the size of a dcache may not match the size of the underlying
file in a couple of RW conditions:

- If someone is writing to a file beyond EOF, the intermediate
  'sparse' area may be populated by 0-length dcaches until the data is
  written to the fileserver.

- Directories may be modified locally instead of being fetched from
  the fileserver, which can sometimes result in a directory blob of
  differing sizes.

To avoid false positives detecting dcache corruption, just skip the
IsDCacheSizeOK check for directories, and any file with pending writes
(CDirty).

Also add some extra information to the logging messages when this
"corruption" is detected, so false positives may be more easily
detected in the future.

Change-Id: I5130287d0de791cffea85aaec5a0899d5c8d092e
Reviewed-on: https://gerrit.openafs.org/13747
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/afs_dcache.c