From bf95b303f41aa416d62fb7a5beb6761329ec9034 Mon Sep 17 00:00:00 2001 From: Lu Fengqi Date: Thu, 22 Jun 2017 16:12:56 +0800 Subject: [PATCH] btrfs-progs: lowmem check: Fix false alert about file extent interrupt As Qu mentioned in this thread (https://www.spinics.net/lists/linux-btrfs/msg64469.html), compression can cause regular extent to co-exist with an inlined extent. This coexistence makes things confusing. Since it is currently allowed and can appear in a filesystem, fix btrfsck to prevent a bunch of error reports to appear that will make user feel uneasy. When checking a file extent, record the extent_end of the regular extent to check if there is a gap between the regular extents. Normally there is only one inlined extent, so the extent_end of inlined extent is useless. However, if a regular extent can co-exist with an inlined extent, the extent_end of the inlined extent also needs to be recorded. Reported-by: Marc MERLIN Signed-off-by: Lu Fengqi Signed-off-by: David Sterba --- cmds-check.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-check.c b/cmds-check.c index a7d3ab3..23adc03 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -4777,6 +4777,7 @@ static int check_file_extent(struct btrfs_root *root, struct btrfs_key *fkey, extent_num_bytes, item_inline_len); err |= FILE_EXTENT_ERROR; } + *end += extent_num_bytes; *size += extent_num_bytes; return err; } -- 2.7.4