attr fork related fstests failures on for-next
Hi,
I'm seeing a couple different fstests failures on current for-next that appear to be associated with e6a688c33238 ("xfs: initialise attr fork on inode create"). The first is xfs_check complaining about sb versionnum bits on various tests:
generic/003 16s ... _check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (c) (see /root/xfstests-dev/results//generic/003.full for details)
# cat results/generic/003.full ... _check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (c) *** xfs_check output *** sb versionnum missing attr bit 10 *** end xfs_check output ... #
With xfs_check bypassed, repair eventually complains about some attr forks. The first point I hit this variant is generic/117:
generic/117 9s ... _check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (r) (see /root/xfstests-dev/results//generic/117.full for details)
# cat results//generic/117.full
...
_check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (r)
*** xfs_repair -n output ***
...
Phase 3 - for each AG...
- scan (but don't clear) agi unlinked lists...
- process known inodes and perform inode discovery...
- agno = 0
bad attr fork offset 24 in dev inode 135, should be 1
would have cleared inode 135
bad attr fork offset 24 in dev inode 142, should be 1
would have cleared inode 142
...Both problems disappear with e6a688c33238 reverted.
Brian
Quoted 7 lines · Brian Foster
Hi,
I'm seeing a couple different fstests failures on current for-next that appear to be associated with
e6a688c33238("xfs: initialise attr fork on inode create"). The first isxfs_checkcomplaining about sb versionnum bits on various tests:
Quoted 8 lines
generic/003 16s ...
_check_xfs_filesystem: filesystem on/dev/mapper/test-scratchis inconsistent (c) (see/root/xfstests-dev/results//generic/003.fullfor details)# cat results/generic/003.full ... _check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (c) *** xfs_check output *** sb versionnum missing attr bit 10 *** end xfs_check output
FWIW I think this because that commit sets up an attr fork without setting ATTR and ATTR2 in sb_version like xfs_bmap_add_attrfork does...
Quoted 8 lines
...
#With
xfs_checkbypassed, repair eventually complains about some attr forks. The first point I hit this variant is generic/117:generic/117 9s ...
_check_xfs_filesystem: filesystem on/dev/mapper/test-scratchis inconsistent (r) (see/root/xfstests-dev/results//generic/117.fullfor details)
Quoted 13 lines
# cat results//generic/117.full
...
_check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (r)
*** xfs_repair -n output ***
...
Phase 3 - for each AG...
- scan (but don't clear) agi unlinked lists...
- process known inodes and perform inode discovery...
- agno = 0
bad attr fork offset 24 in dev inode 135, should be 1
would have cleared inode 135
bad attr fork offset 24 in dev inode 142, should be 1
would have cleared inode 142...and I think this is because xfs_default_attroffset doesn't set the correct value for device files. For those kinds of files, xfs_repair requires the data fork to be exactly 8 bytes.
--D
Quoted 6 lines
...
Both problems disappear with
e6a688c33238reverted.Brian
Quoted 17 lines · Darrick J. Wong
Quoted 7 lines · Brian Foster
Hi,
I'm seeing a couple different fstests failures on current for-next that appear to be associated with
e6a688c33238("xfs: initialise attr fork on inode create"). The first isxfs_checkcomplaining about sb versionnum bits on various tests:Quoted 8 lines
generic/003 16s ...
_check_xfs_filesystem: filesystem on/dev/mapper/test-scratchis inconsistent (c) (see/root/xfstests-dev/results//generic/003.fullfor details)# cat results/generic/003.full ... _check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (c) *** xfs_check output *** sb versionnum missing attr bit 10 *** end xfs_check output
Quoted 2 lines
FWIW I think this because that commit sets up an attr fork without setting ATTR and ATTR2 in
sb_versionlikexfs_bmap_add_attrforkdoes...
Maybe, but mkfs.xfs sets ATTR2 by default and has for a long time. I'm not seeing this fail on either v4 or v5 filesystems on for-next with a current xfsprogs (5.11.0), so what environment is this test failing in?
SECTION -- xfs FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test3 5.12.0-rc5-dgc+ #3074 SMP
PREEMPT Tue Mar 30 07:37:47 AEDT 2021MKFS_OPTIONS -- -f -m rmapbt=1,reflink=1 -i sparse=1 /dev/pmem1 MOUNT_OPTIONS -- /dev/pmem1 /mnt/scratch
generic/003 11s ... 11s
Passed all 1 tests
Xunit report: /home/dave/src/xfstests-dev/results//xfs/result.xml
SECTION -- xfs_v4 FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test3 5.12.0-rc5-dgc+ #3074 SMP
PREEMPT Tue Mar 30 07:37:47 AEDT 2021MKFS_OPTIONS -- -f -m crc=0 /dev/pmem1MOUNT_OPTIONS -- /dev/pmem1 /mnt/scratch
generic/003 11s ... 11s
Passed all 1 tests
Quoted 19 lines
Quoted 5 lines
With
xfs_checkbypassed, repair eventually complains about some attr forks. The first point I hit this variant is generic/117:generic/117 9s ...
_check_xfs_filesystem: filesystem on/dev/mapper/test-scratchis inconsistent (r) (see/root/xfstests-dev/results//generic/117.fullfor details)Quoted 13 lines
# cat results//generic/117.full ... _check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (r) *** xfs_repair -n output *** ... Phase 3 - for each AG... - scan (but don't clear) agi unlinked lists... - process known inodes and perform inode discovery... - agno = 0 bad attr fork offset 24 in dev inode 135, should be 1 would have cleared inode 135 bad attr fork offset 24 in dev inode 142, should be 1 would have cleared inode 142
Quoted 3 lines
...and I think this is because
xfs_default_attroffsetdoesn't set the correct value for device files. For those kinds of files,xfs_repairrequires the data fork to be exactly 8 bytes.
Again, doesn't fail with xfsprogs 5.11.0 here for either v4 or v5 filesystems...
SECTION -- xfs FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test3 5.12.0-rc5-dgc+ #3074 SMP
PREEMPT Tue Mar 30 07:37:47 AEDT 2021MKFS_OPTIONS -- -f -m rmapbt=1,reflink=1 -i sparse=1 /dev/pmem1 MOUNT_OPTIONS -- /dev/pmem1 /mnt/scratch
generic/117 1s ... 2s
Passed all 1 tests
Xunit report: /home/dave/src/xfstests-dev/results//xfs/result.xml
SECTION -- xfs_v4 FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test3 5.12.0-rc5-dgc+ #3074 SMP
PREEMPT Tue Mar 30 07:37:47 AEDT 2021MKFS_OPTIONS -- -f -m crc=0 /dev/pmem1MOUNT_OPTIONS -- /dev/pmem1 /mnt/scratch
generic/117 2s ... 2s
Passed all 1 tests
I'm going to need more information on what environment these failures are being generated in.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 26 lines · Dave Chinner
Quoted 17 lines · Darrick J. Wong
Quoted 7 lines · Brian Foster
Hi,
I'm seeing a couple different fstests failures on current for-next that appear to be associated with
e6a688c33238("xfs: initialise attr fork on inode create"). The first isxfs_checkcomplaining about sb versionnum bits on various tests:Quoted 8 lines
generic/003 16s ...
_check_xfs_filesystem: filesystem on/dev/mapper/test-scratchis inconsistent (c) (see/root/xfstests-dev/results//generic/003.fullfor details)# cat results/generic/003.full ... _check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (c) *** xfs_check output *** sb versionnum missing attr bit 10 *** end xfs_check outputQuoted 2 lines
FWIW I think this because that commit sets up an attr fork without setting ATTR and ATTR2 in
sb_versionlikexfs_bmap_add_attrforkdoes...Maybe, but mkfs.xfs sets ATTR2 by default and has for a long time. I'm not seeing this fail on either v4 or v5 filesystems on for-next with a current xfsprogs (5.11.0), so what environment is this test failing in?
Quoted 6 lines
SECTION -- xfs FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test3 5.12.0-rc5-dgc+ #3074 SMPPREEMPT Tue Mar 30 07:37:47 AEDT 2021
MKFS_OPTIONS-- -f -m rmapbt=1,reflink=1 -i sparse=1/dev/pmem1MOUNT_OPTIONS--/dev/pmem1/mnt/scratch
Ok, this regression test VM had selinux set to permissive so it should have been using selinux. But at some time in the past, "selinux=0" had been added to the kernel CLI, hence turning it off and so not actually testing this path. I have a mix of selinux enabled and disabled test VMs (because test matrix) and it looks like this never made it to a VM that had selinux enabled...
Ok, I can reproduce it now, will fix.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 18 lines · Dave Chinner
Quoted 17 lines · Darrick J. Wong
Quoted 15 lines · Brian Foster
Hi,
I'm seeing a couple different fstests failures on current for-next that appear to be associated with
e6a688c33238("xfs: initialise attr fork on inode create"). The first isxfs_checkcomplaining about sb versionnum bits on various tests:generic/003 16s ...
_check_xfs_filesystem: filesystem on/dev/mapper/test-scratchis inconsistent (c) (see/root/xfstests-dev/results//generic/003.fullfor details)# cat results/generic/003.full ... _check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (c) *** xfs_check output *** sb versionnum missing attr bit 10 *** end xfs_check output
Quoted 4 lines
Quoted 2 lines
FWIW I think this because that commit sets up an attr fork without setting ATTR and ATTR2 in
sb_versionlikexfs_bmap_add_attrforkdoes...Maybe, but mkfs.xfs sets ATTR2 by default and has for a long time.
The xfs_check regression is a result of xfs_db being too stupid to recognize ATTR2.
Quoted 3 lines
I'm not seeing this fail on either v4 or v5 filesystems on for-next with a current xfsprogs (5.11.0), so what environment is this test failing in?
I /think/ any environment where xfs_create_need_xattr returns true is enough to reproduce it; I triggered it by making that function reproduce unconditionally and kicking off anything that runs mknod to create a block device inode.
--D
Quoted 77 lines
SECTION -- xfs FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test3 5.12.0-rc5-dgc+ #3074 SMPPREEMPT Tue Mar 30 07:37:47 AEDT 2021
MKFS_OPTIONS-- -f -m rmapbt=1,reflink=1 -i sparse=1/dev/pmem1MOUNT_OPTIONS--/dev/pmem1/mnt/scratchgeneric/003 11s ... 11s
Passed all 1 tests
Xunit report:/home/dave/src/xfstests-dev/results//xfs/result.xmlSECTION -- xfs_v4 FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test3 5.12.0-rc5-dgc+ #3074 SMPPREEMPT Tue Mar 30 07:37:47 AEDT 2021
MKFS_OPTIONS-- -f -m crc=0/dev/pmem1MOUNT_OPTIONS--/dev/pmem1/mnt/scratchgeneric/003 11s ... 11s
Passed all 1 testsQuoted 19 lines
Quoted 5 lines
With
xfs_checkbypassed, repair eventually complains about some attr forks. The first point I hit this variant is generic/117:generic/117 9s ...
_check_xfs_filesystem: filesystem on/dev/mapper/test-scratchis inconsistent (r) (see/root/xfstests-dev/results//generic/117.fullfor details)Quoted 13 lines
# cat results//generic/117.full ... _check_xfs_filesystem: filesystem on /dev/mapper/test-scratch is inconsistent (r) *** xfs_repair -n output *** ... Phase 3 - for each AG... - scan (but don't clear) agi unlinked lists... - process known inodes and perform inode discovery... - agno = 0 bad attr fork offset 24 in dev inode 135, should be 1 would have cleared inode 135 bad attr fork offset 24 in dev inode 142, should be 1 would have cleared inode 142Quoted 3 lines
...and I think this is because
xfs_default_attroffsetdoesn't set the correct value for device files. For those kinds of files,xfs_repairrequires the data fork to be exactly 8 bytes.Again, doesn't fail with xfsprogs 5.11.0 here for either v4 or v5 filesystems...
SECTION -- xfs FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test3 5.12.0-rc5-dgc+ #3074 SMPPREEMPT Tue Mar 30 07:37:47 AEDT 2021
MKFS_OPTIONS-- -f -m rmapbt=1,reflink=1 -i sparse=1/dev/pmem1MOUNT_OPTIONS--/dev/pmem1/mnt/scratchgeneric/117 1s ... 2s
Passed all 1 tests
Xunit report:/home/dave/src/xfstests-dev/results//xfs/result.xmlSECTION -- xfs_v4 FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test3 5.12.0-rc5-dgc+ #3074 SMPPREEMPT Tue Mar 30 07:37:47 AEDT 2021
MKFS_OPTIONS-- -f -m crc=0/dev/pmem1MOUNT_OPTIONS--/dev/pmem1/mnt/scratchgeneric/117 2s ... 2s
Passed all 1 testsI'm going to need more information on what environment these failures are being generated in.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]