All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs/010: Accept the inconsistencies of sparse records
@ 2019-03-19  7:28 Xiao Yang
  2019-03-23  8:50 ` Eryu Guan
  0 siblings, 1 reply; 3+ messages in thread
From: Xiao Yang @ 2019-03-19  7:28 UTC (permalink / raw)
  To: fstests; +Cc: Xiao Yang

If sparse inode is enabled, running xfs/010 gets the following error:
-----------------------------------------------------
+invalid inode count, AGNO/INO, count 0 ninodes 64
 finobt record with no free inodes, AGNO/INO
+invalid inode count, AGNO/INO, count 0 ninodes 64
-----------------------------------------------------

We corrupt finobt records forcely, so it's reasonable for repair
to detect the inconsistencies of sparse records if sparse inode
is enabled.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tests/xfs/010 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/xfs/010 b/tests/xfs/010
index e220a65..69c019b 100755
--- a/tests/xfs/010
+++ b/tests/xfs/010
@@ -106,8 +106,10 @@ _scratch_unmount
 # corrupt some finobt records
 _corrupt_finobt_records $SCRATCH_DEV
 
-# repair should detect the inconsistencies
-_scratch_xfs_repair 2>&1 | _filter_repair
+# repair should detect the inconsistencies of finobt records
+# repair can also detect the inconsistencies of sparse records if
+# sparse inode is enabled, so accept both of outputs by filtering it.
+_scratch_xfs_repair 2>&1 | _filter_repair | sed -e '/invalid inode count, AGNO\/INO/d'
 _check_scratch_fs
 
 # nuke the finobt root, repair will have to regenerate from the inobt
-- 
1.8.3.1

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

* Re: [PATCH] xfs/010: Accept the inconsistencies of sparse records
  2019-03-19  7:28 [PATCH] xfs/010: Accept the inconsistencies of sparse records Xiao Yang
@ 2019-03-23  8:50 ` Eryu Guan
  2019-03-25  6:59   ` Xiao Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Eryu Guan @ 2019-03-23  8:50 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests

On Tue, Mar 19, 2019 at 03:28:53PM +0800, Xiao Yang wrote:
> If sparse inode is enabled, running xfs/010 gets the following error:
> -----------------------------------------------------
> +invalid inode count, AGNO/INO, count 0 ninodes 64
>  finobt record with no free inodes, AGNO/INO
> +invalid inode count, AGNO/INO, count 0 ninodes 64
> -----------------------------------------------------
> 
> We corrupt finobt records forcely, so it's reasonable for repair
> to detect the inconsistencies of sparse records if sparse inode
> is enabled.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

I cannot reproduce this failure, I'm using xfsprogs from upstream
for-next branch and kernel 5.0.

xfs/010 uses a fixed mkfs option to create the target fs:

_scratch_mkfs_xfs "-m crc=1,finobt=1 -d agcount=2" | _filter_mkfs 2>$seqres.full

So adding "-i sparse" to MKFS_OPTIONS won't create xfs with 'sparse'
enabled in test. And even after editing above mkfs options manually in
test, I still couldn't hit the failure. Did I miss anything?

Thanks,
Eryu

> ---
>  tests/xfs/010 | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/xfs/010 b/tests/xfs/010
> index e220a65..69c019b 100755
> --- a/tests/xfs/010
> +++ b/tests/xfs/010
> @@ -106,8 +106,10 @@ _scratch_unmount
>  # corrupt some finobt records
>  _corrupt_finobt_records $SCRATCH_DEV
>  
> -# repair should detect the inconsistencies
> -_scratch_xfs_repair 2>&1 | _filter_repair
> +# repair should detect the inconsistencies of finobt records
> +# repair can also detect the inconsistencies of sparse records if
> +# sparse inode is enabled, so accept both of outputs by filtering it.
> +_scratch_xfs_repair 2>&1 | _filter_repair | sed -e '/invalid inode count, AGNO\/INO/d'
>  _check_scratch_fs
>  
>  # nuke the finobt root, repair will have to regenerate from the inobt
> -- 
> 1.8.3.1
> 
> 
> 

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

* Re: [PATCH] xfs/010: Accept the inconsistencies of sparse records
  2019-03-23  8:50 ` Eryu Guan
@ 2019-03-25  6:59   ` Xiao Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Xiao Yang @ 2019-03-25  6:59 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests

On 2019/03/23 16:50, Eryu Guan wrote:
> On Tue, Mar 19, 2019 at 03:28:53PM +0800, Xiao Yang wrote:
>> If sparse inode is enabled, running xfs/010 gets the following error:
>> -----------------------------------------------------
>> +invalid inode count, AGNO/INO, count 0 ninodes 64
>>   finobt record with no free inodes, AGNO/INO
>> +invalid inode count, AGNO/INO, count 0 ninodes 64
>> -----------------------------------------------------
>>
>> We corrupt finobt records forcely, so it's reasonable for repair
>> to detect the inconsistencies of sparse records if sparse inode
>> is enabled.
>>
>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> I cannot reproduce this failure, I'm using xfsprogs from upstream
> for-next branch and kernel 5.0.
>
> xfs/010 uses a fixed mkfs option to create the target fs:
>
> _scratch_mkfs_xfs "-m crc=1,finobt=1 -d agcount=2" | _filter_mkfs 2>$seqres.full
>
> So adding "-i sparse" to MKFS_OPTIONS won't create xfs with 'sparse'
> enabled in test. And even after editing above mkfs options manually in
> test, I still couldn't hit the failure. Did I miss anything?
Hi Eryu,

Sorry, this is a xfsprogs bug instead of test problem. :-[
I have confirmed that the xfsprogs bug has been fixed by the followoing 
patch:
'38c599e xfs_db: fix finobt record decoding when sparse inodes enabled'

Best Regards,
Xiao Yang
> Thanks,
> Eryu
>
>> ---
>>   tests/xfs/010 | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/xfs/010 b/tests/xfs/010
>> index e220a65..69c019b 100755
>> --- a/tests/xfs/010
>> +++ b/tests/xfs/010
>> @@ -106,8 +106,10 @@ _scratch_unmount
>>   # corrupt some finobt records
>>   _corrupt_finobt_records $SCRATCH_DEV
>>
>> -# repair should detect the inconsistencies
>> -_scratch_xfs_repair 2>&1 | _filter_repair
>> +# repair should detect the inconsistencies of finobt records
>> +# repair can also detect the inconsistencies of sparse records if
>> +# sparse inode is enabled, so accept both of outputs by filtering it.
>> +_scratch_xfs_repair 2>&1 | _filter_repair | sed -e '/invalid inode count, AGNO\/INO/d'
>>   _check_scratch_fs
>>
>>   # nuke the finobt root, repair will have to regenerate from the inobt
>> -- 
>> 1.8.3.1
>>
>>
>>
>
>

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

end of thread, other threads:[~2019-03-25  6:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19  7:28 [PATCH] xfs/010: Accept the inconsistencies of sparse records Xiao Yang
2019-03-23  8:50 ` Eryu Guan
2019-03-25  6:59   ` Xiao Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.