linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/4] btrfs-progs: lowmem check: Fix false alert about file extent interrupt
@ 2017-06-26 10:37 Lu Fengqi
  2017-06-26 10:37 ` [PATCH v3 2/4] btrfs-progs: lowmem check: Fix false alert about referencer count mismatch Lu Fengqi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lu Fengqi @ 2017-06-26 10:37 UTC (permalink / raw)
  To: linux-btrfs; +Cc: marc

As Qu mentioned in this thread
(https://www.spinics.net/lists/linux-btrfs/msg64469.html), compression
can cause regular extent to co-exist with inlined extent. This coexistence
makes things confusing. Since it was permitted currently, so fix
btrfsck to prevent a bunch of error logs that will make user feel
panic.

When check file extent, record the extent_end of 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 regular extent can co-exist with inlined extent, the extent_end of
inlined extent also need to record.

Reported-by: Marc MERLIN <marc@merlins.org>
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
---

Changlog:
v2: Just fix reported-by
v3: Output verbose information when file extent interrupt

 cmds-check.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index c052f66e..70d2b7f2 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -4782,6 +4782,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;
 	}
@@ -4847,8 +4848,8 @@ static int check_file_extent(struct btrfs_root *root, struct btrfs_key *fkey,
 		      root->objectid, fkey->objectid, fkey->offset);
 	} else if (!no_holes && *end != fkey->offset) {
 		err |= FILE_EXTENT_ERROR;
-		error("root %llu EXTENT_DATA[%llu %llu] interrupt",
-		      root->objectid, fkey->objectid, fkey->offset);
+		error("root %llu EXTENT_DATA[%llu %llu] interrupt, should start at %llu",
+		      root->objectid, fkey->objectid, fkey->offset, *end);
 	}
 
 	*end += extent_num_bytes;
-- 
2.13.1




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-03  2:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-26 10:37 [PATCH v3 1/4] btrfs-progs: lowmem check: Fix false alert about file extent interrupt Lu Fengqi
2017-06-26 10:37 ` [PATCH v3 2/4] btrfs-progs: lowmem check: Fix false alert about referencer count mismatch Lu Fengqi
2017-07-02 13:50   ` Henk Slager
2017-07-03  2:55     ` Lu Fengqi
2017-06-26 10:37 ` [PATCH v3 3/4] btrfs-progs: test: Add test image for lowmem mode file extent interrupt Lu Fengqi
2017-06-26 10:37 ` [PATCH v3 4/4] btrfs-progs: test: Add test image for lowmem mode referencer count mismatch false alert Lu Fengqi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).