summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-06-02 19:48:27 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-10 07:17:09 -0400
commit379dd295019c9e11d19f660a857170ee1bd74f63 (patch)
tree59332e1368095d1a9f6a6a88f88d68a8a2dad8c3 /tools/perf/scripts/python/stackcollapse.py
parent00d26f3a47e44bd7662de33b89dd84a3837e2959 (diff)
bcachefs: Fix subvol to missing root repair
commit 29cc6fb7c068c773049d3bde14b939033893eff4 upstream. We had a bug where the root inode of a subvolume was erronously deleted: bch2_evict_inode() called bch2_inode_rm(), meaning the VFS inode's i_nlink was somehow set to 0 when it shouldn't have - the inode in the btree indicated it clearly was not unlinked. This has been addressed with additional safety checks in bch2_inode_rm() - pulling in the safety checks we already were doing when deleting unlinked inodes in recovery - but the really disastrous bug was in check_subvols(), which on finding a dangling subvol (subvol with a missing root inode) would delete the subvolume. I assume this bug dates from early check_directory_structure() code, which originally handled subvolumes and normal paths - the idea being that still live contents of the subvolume would get reattached somewhere. But that's incorrect, and disastrously so; deleting a subvolume triggers deleting the snapshot ID it points to, deleting the entire contents. The correct way to repair is to recreate the root inode if it's missing; then any contents will get reattached under that subvolume's lost+found. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions