Btrfs-progs: Handle bad extent type case
diff mbox

Message ID 1277744116-7805-2-git-send-regression-fweisbec@gmail.com
State New, archived
Headers show

Commit Message

Frederic Weisbecker June 28, 2010, 4:55 p.m. UTC
None

Patch
diff mbox

diff --git a/btrfs-list.c b/btrfs-list.c
index 9dedb5d..c90a1e6 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -698,6 +698,15 @@  static int print_one_extent(int fd, struct btrfs_ioctl_search_header *sh,
 		disk_start = 0;
 		disk_offset = 0;
 		len = btrfs_stack_file_extent_ram_bytes(item);
+	} else {
+		printf("unhandled extent type %d for inode %llu "
+		       "file offset %llu gen %llu\n",
+			type,
+			(unsigned long long)sh->objectid,
+			(unsigned long long)sh->offset,
+			(unsigned long long)found_gen);
+
+		return -EIO;
 	}
 	printf("inode %llu file offset %llu len %llu disk start %llu "
 	       "offset %llu gen %llu flags ",