btrfs-progs: check: Fix false alert about EXTENT_DATA that shouldn't be a hole

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>
master
Qu Wenruo 2017-06-16 09:43:22 +08:00 committed by David Sterba
parent 324d4c1857
commit 163ca0e431
1 changed files with 1 additions and 5 deletions

View 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);