Unionfs: cache-coherency calls to maintain the time invariants
This patch represents several types of related changes. First, we invoke
functions to synchronize the upper and lower times as and when needed. Many
of these were bug fixes which were discovered during the development of the
cache-coherency code. That is, Unionfs itself wasn't maintaining
appropriate
times in some places, which if not fixed would have been detected by the
invariant-checking code as a false positive (incorrectly considered as if a
user modified the lower objects directly).
Second, we do not call invariant-validation functions (unionfs_check_file,
unionfs_check_dentry, etc.) until *after* we've revalidated them. Otherwise
we produced false positives.
Third, we pass a flag "willwrite" to __unionfs_d_revalidate_chain to tell it
to purge data pages if the inode lower times appear to be newer.
See Documentation/filesystems/unionfs/concepts.txt under the "Cache
Coherency" section for more details of this design and implementation.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>