btrfsck: don't BUG on corrupted extent records
authorChris Mason <chris.mason@oracle.com>
Mon, 6 Feb 2012 13:53:43 +0000 (08:53 -0500)
committerChris Mason <chris.mason@oracle.com>
Mon, 6 Feb 2012 13:53:43 +0000 (08:53 -0500)
btrfsck.c

index 747bdd0..f09945f 100644 (file)
--- a/btrfsck.c
+++ b/btrfsck.c
@@ -2441,11 +2441,14 @@ static int process_extent_item(struct cache_tree *extent_cache,
                                        0);
                        break;
                default:
-                       BUG();
+                       fprintf(stderr, "corrupt extent record: key %Lu %u %Lu\n",
+                               key.objectid, key.type, key.offset);
+                       goto out;
                }
                ptr += btrfs_extent_inline_ref_size(type);
        }
        WARN_ON(ptr > end);
+out:
        return 0;
 }