Skip to content

[CHERRY-PICK] FatPkg: Clean any volume caches during exit boot services#1832

Merged
cfernald merged 1 commit into
microsoft:release/202511from
cfernald:cp_fat_flush
Jun 24, 2026
Merged

[CHERRY-PICK] FatPkg: Clean any volume caches during exit boot services#1832
cfernald merged 1 commit into
microsoft:release/202511from
cfernald:cp_fat_flush

Conversation

@cfernald

Copy link
Copy Markdown
Contributor

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.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Tested on QEMU with one-off shell test and boot to OS

Integration Instructions

N/A

@cfernald cfernald requested review from makubacki, os-d and vineelko June 22, 2026 22:13
@mu-automation

mu-automation Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

⏩ QEMU Validation Skipped

The PR was merged before validation completed.

This comment was automatically generated by the Mu QEMU PR Validation workflow.

@cfernald cfernald enabled auto-merge (rebase) June 22, 2026 22:23

@os-d os-d left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We've been doing git cherry-pick -x to get the cherry-picked commit hash in the commit message for easy reference.

Comment thread FatPkg/EnhancedFatDxe/Misc.c
@cfernald cfernald force-pushed the cp_fat_flush branch 2 times, most recently from 895f1c0 to 5fb3e12 Compare June 23, 2026 14:37
@cfernald cfernald force-pushed the cp_fat_flush branch 2 times, most recently from 07c594f to 7af5a99 Compare June 23, 2026 20:57
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)
@cfernald cfernald merged commit 733cc7e into microsoft:release/202511 Jun 24, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants