Skip to content

Commit a7f9db3

Browse files
committed
contrib/btrfs_orphan_subvolumes.py: handle inodes with no cached names
Reported-by: Sweet Tea Dorminy <[email protected]> Signed-off-by: Omar Sandoval <[email protected]>
1 parent 35bc08e commit a7f9db3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

contrib/btrfs_orphan_subvolumes.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ def dump_orphan_subvolumes(fs_info: Object) -> None:
2020
for inode in rbtree_inorder_for_each_entry(
2121
"struct btrfs_inode", root.inode_tree.address_of_(), "rb_node"
2222
):
23-
path = inode_path(inode.vfs_inode.address_of_()).decode()
24-
print(f" {path}")
23+
path = inode_path(inode.vfs_inode.address_of_())
24+
if path is None:
25+
print(f" inode {inode.vfs_inode.i_ino.value_()} with no cached names")
26+
else:
27+
print(f" {path.decode()}")
2528

2629

2730
if __name__ == "__main__":

0 commit comments

Comments
 (0)