diff options
| author | Tal Zussman <tz2294@columbia.edu> | 2026-10-15 10:43:16 -0400 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-10-16 19:10:45 +0200 |
| commit | fab81e9b9326582233f36d594c44bea9e66f8b52 (patch) | |
| tree | 4f3cb7889d6b0768cdbf9703ffc73eded6c7437a /scripts/Makefile.thinlto | |
| parent | 4e89aff9ad6fcbec555c38169807c4023f93450f (diff) | |
| download | linux-fab81e9b9326582233f36d594c44bea9e66f8b52.tar.gz linux-fab81e9b9326582233f36d594c44bea9e66f8b52.zip | |
btrfs: stop enabling the v1 space cache from the on-disk state
Since commit 545e560a5b0f ("btrfs: disable v1 space cache") the mount
options can no longer request the v1 space cache, but a filesystem with
an active v1 cache and no free space tree still enables it from
cache_generation, and remount does the same. Drop both, so SPACE_CACHE
can never be set.
btrfs_start_pre_rw_mount() then sees the on-disk cache as active but
unwanted and cleans it up, as -o nospace_cache does today. That covers
the read-only to read-write remount as well, so drop the toggle in
btrfs_remount_cleanup(), which would otherwise start a transaction on
remounts of a read-only filesystem with an old cache.
When a remount that isn't read-only to read-write asks to change the
free space tree, btrfs_reconfigure() warns and keeps the on-disk state,
but the fixup that resets the options only ran for a filesystem with a
free space tree or an active v1 cache. On one with neither, a requested
FREE_SPACE_TREE stayed set and the next read-write remount created the
tree. Clear it whenever the tree is not on disk, which also covers a v1
filesystem once its cache has been cleaned up.
The cleanup is now unconditional, and the first read-write mount fails
if it fails, as it did with -o nospace_cache. This also lets an old
filesystem mount without options when the page size is larger than the
sector size, which btrfs_check_features() rejected once SPACE_CACHE was
set from the superblock.
Assisted-by: LLM
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
