ret = search_tree(fs, fs_tree, &search_key, &path);
if (ret) { /* impossible */
printf("btrfs: search extent data error!\n");
- return 0;
+ return -1;
}
extent_item = *(struct btrfs_file_extent_item *)path.data;
+ if (extent_item.encryption) {
+ printf("btrfs: found encrypted data, cannot continue!\n");
+ return -1;
+ }
+ if (extent_item.compression) {
+ printf("btrfs: found compressed data, cannot continue!\n");
+ return -1;
+ }
+
if (extent_item.type == BTRFS_FILE_EXTENT_INLINE) {/* inline file */
/* we fake a extent here, and PVT of inode will tell us */
offset = path.offsets[0] + sizeof(struct btrfs_header)
if (!inode->this_extent.len) {
/* Doesn't matter if it's contiguous... */
inode->this_extent = inode->next_extent;
+ if (!inode->next_extent.len) {
+ sectors = 0; /* Failed to get anything... we're dead */
+ break;
+ }
} else if (inode->next_extent.len &&
inode->next_extent.pstart == next_pstart(&inode->this_extent)) {
/* Coalesce extents and loop */