diff options
| author | Cheng Yongkang <teel4res@gmail.com> | 2026-10-31 23:25:39 -0700 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-11-09 18:50:58 +0100 |
| commit | 9a58e56e70f610e29b53821e9c706600e529cca3 (patch) | |
| tree | 33365cfce3ba989cfb853baabe3e22ec56ab9c8d /tools/perf/scripts/python | |
| parent | bb66a38f5812f2c04abd4eb6e586a12b5a95172a (diff) | |
btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT
btrfs_ioctl_subvol_sync() assumes that a cached root with zero
references has BTRFS_ROOT_SUBVOL_DEAD set, and asserts that before
waiting for the cleaner. Two states break the assumption:
- A corrupt ROOT_ITEM with zero references and a matching orphan item,
on a writable filesystem.
- A failed subvolume deletion. btrfs_delete_subvolume() zeroes the
root references, aborts the transaction, which forces the filesystem
read-only, and then clears DEAD again. No on-disk metadata is
corrupted in this case.
With CONFIG_BTRFS_ASSERT=y, both reach a BUG().
Change the ASSERT() into a proper rejection to avoid triggering a BUG().
Fixes: 6c83d153ed86 ("btrfs: add new ioctl to wait for cleaned subvolumes")
CC: stable@vger.kernel.org
Suggested-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Link: https://lore.kernel.org/linux-btrfs/dd97efe9-91ec-495b-b698-acff1447421c@gmx.com/
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
[ Rework the commit message, drop the ad-hoc RW check. ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
