Skip to content

Commit

Permalink
contrib/btrfs_orphan_subvolumes.py: handle inodes with no cached names
Browse files Browse the repository at this point in the history
Reported-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Omar Sandoval <osandov@osandov.com>
  • Loading branch information
osandov committed Dec 11, 2023
1 parent 35bc08e commit a7f9db3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contrib/btrfs_orphan_subvolumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def dump_orphan_subvolumes(fs_info: Object) -> None:
for inode in rbtree_inorder_for_each_entry(
"struct btrfs_inode", root.inode_tree.address_of_(), "rb_node"
):
path = inode_path(inode.vfs_inode.address_of_()).decode()
print(f" {path}")
path = inode_path(inode.vfs_inode.address_of_())
if path is None:
print(f" inode {inode.vfs_inode.i_ino.value_()} with no cached names")
else:
print(f" {path.decode()}")


if __name__ == "__main__":
Expand Down

0 comments on commit a7f9db3

Please sign in to comment.