diff options
| author | Tal Zussman <tz2294@columbia.edu> | 2026-10-15 10:43:15 -0400 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-10-16 19:10:45 +0200 |
| commit | 4e89aff9ad6fcbec555c38169807c4023f93450f (patch) | |
| tree | ee689d39ca4aaf52639d3676c19b0db0a2a2f458 /scripts/Makefile.thinlto | |
| parent | bca2cf55a7331e6b0ff95ad47fc2a7e8ecc7dc74 (diff) | |
| download | linux-4e89aff9ad6fcbec555c38169807c4023f93450f.tar.gz linux-4e89aff9ad6fcbec555c38169807c4023f93450f.zip | |
btrfs: update the inode item when removing a free space inode
btrfs_remove_free_space_inode() adds an orphan item for the free space
inode and clears its link count in memory, but never writes the inode
item. The item is only removed once the delayed iput evicts the inode,
which happens in a later transaction, from the cleaner thread or a
throttled transaction end.
If we crash in between, or if evict can't reserve space for the
truncation and leaves the orphan item for the next mount, the on-disk
inode still has a link count of 1. btrfs_orphan_cleanup() then treats it
as an inode with links and only deletes the orphan item. The free space
header item is already gone at that point, so nothing ever finds the
inode again, and its data extents are leaked.
Write the zero link count to the inode item in the same transaction as
the orphan item, so the orphan cleanup evicts the inode instead. Account
for the extra tree root item update when removing a block group.
Fixes: 455757c322cc ("Btrfs: delay iput when deleting a block group")
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
