btrfs-progs: verbose error when we find an unexpected item in sys_array
authorDavid Sterba <dsterba@suse.com>
Mon, 30 Nov 2015 16:10:20 +0000 (17:10 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Jan 2016 10:28:24 +0000 (11:28 +0100)
Signed-off-by: David Sterba <dsterba@suse.com>
volumes.c

index b4d489a..492dcd2 100644 (file)
--- a/volumes.c
+++ b/volumes.c
@@ -1855,7 +1855,11 @@ int btrfs_read_sys_array(struct btrfs_root *root)
                        if (ret)
                                break;
                } else {
-                       BUG();
+                       printk(
+               "ERROR: unexpected item type %u in sys_array at offset %u\n",
+                               (u32)key.type, cur_offset);
+                       ret = -EIO;
+                       break;
                }
                array_ptr += len;
                sb_array_offset += len;