btrfs-progs: check: Fix false alert about EXTENT_DATA that shouldn't be a hole
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 16 Jun 2017 01:43:22 +0000 (09:43 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Jun 2017 15:09:58 +0000 (17:09 +0200)
Since the incompat feature NO_HOLES still allows us to have an explicit
hole file extent, current check is too strict and will cause false
alerts like:

  root 5 EXTENT_DATA[257, 0] shouldn't be hole

Fix it by removing the strict file hole extent check.

Link: https://www.spinics.net/lists/linux-btrfs/msg66374.html
Reported-by: Henk Slager <eye1tm@gmail.com>
Tested-by: Henk Slager <eye1tm@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c

index ad7c81b..a7d3ab3 100644 (file)
@@ -4836,11 +4836,7 @@ static int check_file_extent(struct btrfs_root *root, struct btrfs_key *fkey,
        }
 
        /* Check EXTENT_DATA hole */
-       if (no_holes && is_hole) {
-               err |= FILE_EXTENT_ERROR;
-               error("root %llu EXTENT_DATA[%llu %llu] shouldn't be hole",
-                     root->objectid, fkey->objectid, fkey->offset);
-       } else if (!no_holes && *end != fkey->offset) {
+       if (!no_holes && *end != fkey->offset) {
                err |= FILE_EXTENT_ERROR;
                error("root %llu EXTENT_DATA[%llu %llu] interrupt",
                      root->objectid, fkey->objectid, fkey->offset);