diff options
| author | Chi Zhiling <chizhiling@kylinos.cn> | 2026-09-04 11:26:41 +0800 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-10-21 08:28:28 +0900 |
| commit | 7d390ca06fe71b6959c8c983a9e43230220029e4 (patch) | |
| tree | c9c7bb61837de96aec091efc60fa53ca296bf5df /scripts/Makefile.thinlto | |
| parent | 61011fb95c5d1f4aa2de4c0d75c5f5ad08917c4b (diff) | |
| download | linux-7d390ca06fe71b6959c8c983a9e43230220029e4.tar.gz linux-7d390ca06fe71b6959c8c983a9e43230220029e4.zip | |
exfat: clear the volume dirty flag only when remounting read-only
exfat_reconfigure() does not hold s_lock while calling
sync_filesystem(). Therefore, the filesystem can become dirty again
between the sync and clearing the volume dirty flag, leaving a dirty
filesystem with a clean volume flag.
Holding s_lock across sync_filesystem() is not an option because it can
lead to a deadlock: writeback takes s_lock in exfat_write_inode().
Instead, clear the volume dirty flag only when remounting the filesystem
read-only, where no writer can modify the filesystem after the sync.
For a normal read-only remount, reconfigure_super() calls
sb_prepare_remount_readonly() before ->reconfigure(), which returns
-EBUSY if any writer is still active. Afterwards
sb_start_ro_state_change() sets sb->s_readonly_remount, so
mnt_get_write_access() fails with -EROFS and no new writer can start
until the reconfiguration finishes. Therefore no writer can race with
the sync and the clearing.
Forced remounts are different: with SB_FORCE, reconfigure_super() skips
sb_prepare_remount_readonly(), so the writers active at that moment are
not blocked and can still dirty the filesystem after the sync. Do not
clear the volume dirty flag in this case.
Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
