implement acquire/release for ccflush #753
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
seems to fix various deadlock scenarios when writing in windows 11
what appears to happen is that ccflush magically acquires locks if we don't acquire them explicitly. this then results in a deadlock where the ccflush thread is holding the lock and waiting for writing to happen (somewhere inside CcFlushCacheOneRange). meanwhile one of our threads is stuck waiting for the lock (somewhere inside drv_write).
(I am not super sure that is the right thing to do, but looking at ext4fsd it also implements these functions with actual acquire and release. also I don't understand the implications of FSRTL_CACHE_TOP_LEVEL_IRP)