[NTOSKRNL] Don't mark VACB dirty on unpin
authorPierre Schweitzer <pierre@reactos.org>
Wed, 17 Apr 2019 20:23:57 +0000 (22:23 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Wed, 17 Apr 2019 20:35:19 +0000 (22:35 +0200)
commit8b6696fcdb5897d41a1692e1bf43f464c4ef3996
tree5ee15d2995744acca144dca42d807bcab00a2093
parentfeb9c045cf92f4de0f7a96581de5691ade1960f6
[NTOSKRNL] Don't mark VACB dirty on unpin

This could happen if BCB was marked dirty previously.
Marking VACB dirty on unpin could lead to a double write of
the VACB, even if clean.
Indeed, now that setting BCB dirty leads to marking VACB
dirty, the VACB can be flushed in between by the lazy-writer.
The BCB state is not reset on VACB flush, contrary to the VACB state.
Thus, on unpin even if the VACB was already flushed, we were
setting back the dirty state, leading the VACB to be flushed again.

This could bring a small performance downgrade. Though it remains
limited since this is mostly used for FS metadata.
Possibly it could lead to metadata corruption, but this is likely
less possible.

CORE-15954
ntoskrnl/cc/pin.c