[CHERRY-PICK] FatPkg: Clean any volume caches during exit boot services#1832
Merged
Conversation
Contributor
⏩ QEMU Validation SkippedThe PR was merged before validation completed. This comment was automatically generated by the Mu QEMU PR Validation workflow. |
os-d
approved these changes
Jun 22, 2026
os-d
left a comment
Contributor
There was a problem hiding this comment.
nit: We've been doing git cherry-pick -x to get the cherry-picked commit hash in the commit message for easy reference.
makubacki
approved these changes
Jun 22, 2026
895f1c0 to
5fb3e12
Compare
apop5
approved these changes
Jun 23, 2026
07c594f to
7af5a99
Compare
The current implementation assumes the the caller will perform the necessary cleanup before exiting boot services. This has been observed to drop some cached file writes that occur even before the application calling exit boot services is launched. This commit adds a per-volume pre-ExitBootServices event to flush any dirty caches and perform other cleanup the volume to ensure all write data is persisted and consistent. After the flush, caching will be disabled for the volume in the future to ensure that all subsequent access persists. Signed-off-by: Chris Fernald <chfernal@microsoft.com> (cherry picked from commit 12c5ded287fc142380b0f9efab3b6ac47c2d1067)
apop5
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The current implementation assumes the the caller will perform the necessary cleanup before exiting boot services. This has been observed to drop some cached file writes that occur even before the application calling exit boot services is launched.
This commit adds a per-volume pre-ExitBootServices event to flush any dirty caches and perform other cleanup the volume to ensure all write data is persisted and consistent. After the flush, caching will be disabled for the volume in the future to ensure that all subsequent access persists.
How This Was Tested
Tested on QEMU with one-off shell test and boot to OS
Integration Instructions
N/A