linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: lowmem check: Fix false alert about file extent interrupt
@ 2017-06-22  7:52 Lu Fengqi
  2017-06-22  8:12 ` [PATCH v2] " Lu Fengqi
  0 siblings, 1 reply; 5+ messages in thread
From: Lu Fengqi @ 2017-06-22  7:52 UTC (permalink / raw)
  To: linux-btrfs

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: Chris Murphy <lists@colorremedies.com>
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
---
 cmds-check.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cmds-check.c b/cmds-check.c
index c052f66e..c173d285 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;
 	}
-- 
2.13.1




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

* [PATCH v2] btrfs-progs: lowmem check: Fix false alert about file extent interrupt
  2017-06-22  7:52 [PATCH] btrfs-progs: lowmem check: Fix false alert about file extent interrupt Lu Fengqi
@ 2017-06-22  8:12 ` Lu Fengqi
  2017-06-26 14:55   ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Lu Fengqi @ 2017-06-22  8:12 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>
---

Sorry, I mistook the reporter in v1.
Changes since v1:
- Fix the reported-by.

 cmds-check.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cmds-check.c b/cmds-check.c
index c052f66e..c173d285 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;
 	}
-- 
2.13.1




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

* Re: [PATCH v2] btrfs-progs: lowmem check: Fix false alert about file extent interrupt
  2017-06-22  8:12 ` [PATCH v2] " Lu Fengqi
@ 2017-06-26 14:55   ` David Sterba
  2017-06-27  5:37     ` Lu Fengqi
  0 siblings, 1 reply; 5+ messages in thread
From: David Sterba @ 2017-06-26 14:55 UTC (permalink / raw)
  To: Lu Fengqi; +Cc: linux-btrfs, marc

On Thu, Jun 22, 2017 at 04:12:56PM +0800, Lu Fengqi wrote:
> 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>

Applied, thanks.

Do you have a test for that?

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

* Re: [PATCH v2] btrfs-progs: lowmem check: Fix false alert about file extent interrupt
  2017-06-26 14:55   ` David Sterba
@ 2017-06-27  5:37     ` Lu Fengqi
  2017-06-27 12:06       ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Lu Fengqi @ 2017-06-27  5:37 UTC (permalink / raw)
  To: dsterba, linux-btrfs

On Mon, Jun 26, 2017 at 04:55:04PM +0200, David Sterba wrote:
>On Thu, Jun 22, 2017 at 04:12:56PM +0800, Lu Fengqi wrote:
>> 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>
>
>Applied, thanks.
>
>Do you have a test for that?

Yes, I have already posted this testcase
(https://www.spinics.net/lists/linux-btrfs/msg66802.html) yesterday. In
addition, this patch has an updated version
(https://www.spinics.net/lists/linux-btrfs/msg66803.html) which make
lowmem mode output more detailed information when file extent interrupt.
Since the patch v2 has been applied, then I will send a patch for this
modification alone.

-- 
Thanks,
Lu



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

* Re: [PATCH v2] btrfs-progs: lowmem check: Fix false alert about file extent interrupt
  2017-06-27  5:37     ` Lu Fengqi
@ 2017-06-27 12:06       ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-06-27 12:06 UTC (permalink / raw)
  To: Lu Fengqi; +Cc: linux-btrfs

On Tue, Jun 27, 2017 at 01:37:47PM +0800, Lu Fengqi wrote:
> On Mon, Jun 26, 2017 at 04:55:04PM +0200, David Sterba wrote:
> >On Thu, Jun 22, 2017 at 04:12:56PM +0800, Lu Fengqi wrote:
> >> 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>
> >
> >Applied, thanks.
> >
> >Do you have a test for that?
> 
> Yes, I have already posted this testcase
> (https://www.spinics.net/lists/linux-btrfs/msg66802.html) yesterday.

I see, thanks.

> In
> addition, this patch has an updated version
> (https://www.spinics.net/lists/linux-btrfs/msg66803.html) which make
> lowmem mode output more detailed information when file extent interrupt.
> Since the patch v2 has been applied, then I will send a patch for this
> modification alone.

I'll replace the patch with v3.

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

end of thread, other threads:[~2017-06-27 12:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-22  7:52 [PATCH] btrfs-progs: lowmem check: Fix false alert about file extent interrupt Lu Fengqi
2017-06-22  8:12 ` [PATCH v2] " Lu Fengqi
2017-06-26 14:55   ` David Sterba
2017-06-27  5:37     ` Lu Fengqi
2017-06-27 12:06       ` David Sterba

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).