[PATCH] Btrfs-progs: fix segmentation fault of 'btrfs-debug-tree -e'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Due to some historical reasons, we remove 'printing leaf' part, which'd
lead to 'Segmentation fault' of btrfs-debug-tree -e, this patch adds it
back.

Signed-off-by: Liu Bo <bo.li.liu@xxxxxxxxxx>
---
 debug-tree.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/debug-tree.c b/debug-tree.c
index f6bd5d8..02b0389 100644
--- a/debug-tree.c
+++ b/debug-tree.c
@@ -52,6 +52,11 @@ static void print_extents(struct btrfs_root *root, struct extent_buffer *eb)
 	if (!eb)
 		return;
 
+	if (btrfs_is_leaf(eb)) {
+		btrfs_print_leaf(root, eb);
+		return;
+	}
+
 	size = btrfs_level_size(root, btrfs_header_level(eb) - 1);
 	nr = btrfs_header_nritems(eb);
 	for (i = 0; i < nr; i++) {
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux