afs: Reintroduce and use DFlushDCache()
commit799d789fbaefc8c4dbcb803b885deb35f4947d26
authorAndrew Deason <adeason@sinenomine.net>
Thu, 25 Apr 2024 20:58:49 +0000 (25 15:58 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 26 Apr 2024 22:47:45 +0000 (26 18:47 -0400)
treed0b08f601597def4e2a8b478fd0963823a753747
parent407c6371572b1b7e815f30c0718e14b1c6b385e5
afs: Reintroduce and use DFlushDCache()

This reverts commit 432ac5810e51bb5bb2cf1df0bfebc64d1c4d7a39 (afs:
Remove DFlushDCache()). This also re-adds the caller of DFlushDCache()
removed by commit 4045f3d5350955de91e019b09ad2ed7941f6dadb
(disconnected-shadow-directory-fixes-20090121), and the prototype
removed by commit 5ad1e6cb904b953fbb04603f3ce1466dcc38cd48 (dir:
Prototype and function name cleanup).

The removal of the DFlushDCache() call in commit 4045f3d535 seems like
a mistake. If the directory in question has dirty pages in memory, we
need to flush those to the cache before making a copy of the
directory's data, because we read the existing dir's data from the
cache. If we don't flush, afs_MakeShadowDir() might make a copy of the
dcache that is missing updates to the directory blob.

Change-Id: I4f26103b3db5e1ebdbe3324d2d9f67b39ab22e09
Reviewed-on: https://gerrit.openafs.org/15740
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
src/afs/afs_buffer.c
src/afs/afs_dcache.c
src/afs/afs_prototypes.h