From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: Eryu Guan <guan@eryu.me>
Cc: "djwong@kernel.org" <djwong@kernel.org>,
"fstests@vger.kernel.org" <fstests@vger.kernel.org>
Subject: Re: [PATCH v3] xfs/12[4-6]: Add getfattr operation after xattr corrupted
Date: Thu, 27 Jan 2022 03:02:36 +0000 [thread overview]
Message-ID: <61F20B74.1090008@fujitsu.com> (raw)
In-Reply-To: <Ye1TiTOUdGoemiV9@desktop>
on 2022/1/23 21:09, Eryu Guan wrote:
> On Mon, Jan 17, 2022 at 04:22:16PM +0800, Yang Xu wrote:
>> Add getfattr operation in these three cases, we can also use xfs/126(corrupt a leaf
>> xattr's data extent) to reproduce a deadlock. This deadlock is introduced by kernel
>> commit 07120f1abdff ("xfs: Add xfs_has_attr and subroutines") and fixed by kernel
>
> So this was introduced since 5.9 kernel, and
>
>> commit a1de97fe296c ("xfs: Fix the free logic of state in xfs_attr_node_hasname").
>
> fixed in 5.16 kernel.
>
> And adding this regression test in xfs/126, which passed in the past.
> probably would cause all the affected kernels in between start to hang,
> and trigger a false positive regression alert.
>
> So IMO it'd be better to make a separated& targeted regression test for
> this case, as Darrick suggested.
Ok, Now, I understand but don't figure out how to setattr to use leaf
attr block accuratly and corrupt leaf attr accuratly even I have read
the documentation[1] instead of xfs/126 using generic fuzz way.
So if somebody can do this or teach me, I will be pleasure.
[1]https://github.com/djwong/xfs-documentation/blob/master/design/XFS_Filesystem_Structure/extended_attributes.asciidoc
Best Regards
Yang Xu
>
> Thanks,
> Eryu
>
>>
>> Also making getfattr operation after xattr corrupted is a common part, so we can
>> test whether the similar deadlock occurs in the future in xfs/124(corrupt a block xattr)
>> and xfs/125(corrupt a leaf xattr's index extent).
>>
>> Signed-off-by: Yang Xu<xuyang2018.jy@fujitsu.com>
>> ---
>> tests/xfs/124 | 2 +-
>> tests/xfs/125 | 2 +-
>> tests/xfs/126 | 2 +-
>> 3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/tests/xfs/124 b/tests/xfs/124
>> index 39307218..c3cccfd5 100755
>> --- a/tests/xfs/124
>> +++ b/tests/xfs/124
>> @@ -64,7 +64,7 @@ _scratch_xfs_db -x -c "inode ${inode}" -c 'ablock 0' -c "stack" -c "blocktrash -
>>
>> echo "+ mount image&& modify xattr"
>> if _try_scratch_mount>> $seqres.full 2>&1; then
>> -
>> + getfattr "${SCRATCH_MNT}/attrfile" -n "user.x00000000" 2> /dev/null&& _fail "got corrupt xattr"
>> setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null&& _fail "modified corrupt xattr"
>> umount "${SCRATCH_MNT}"
>> fi
>> diff --git a/tests/xfs/125 b/tests/xfs/125
>> index fb5f5695..a7eb51fb 100755
>> --- a/tests/xfs/125
>> +++ b/tests/xfs/125
>> @@ -64,7 +64,7 @@ _scratch_xfs_db -x -c "inode ${inode}" -c 'ablock 0' -c "stack" -c "blocktrash -
>>
>> echo "+ mount image&& modify xattr"
>> if _try_scratch_mount>> $seqres.full 2>&1; then
>> -
>> + getfattr "${SCRATCH_MNT}/attrfile" -n "user.x00000000" 2> /dev/null&& _fail "got corrupt xattr"
>> setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null&& _fail "modified corrupt xattr"
>> umount "${SCRATCH_MNT}"
>> fi
>> diff --git a/tests/xfs/126 b/tests/xfs/126
>> index c3a74b1c..519d377e 100755
>> --- a/tests/xfs/126
>> +++ b/tests/xfs/126
>> @@ -69,7 +69,7 @@ done
>>
>> echo "+ mount image&& modify xattr"
>> if _try_scratch_mount>> $seqres.full 2>&1; then
>> -
>> + getfattr "${SCRATCH_MNT}/attrfile" -n "user.x00000000" 2> /dev/null&& _fail "got corrupt xattr"
>> setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null&& _fail "modified corrupt xattr"
>> umount "${SCRATCH_MNT}"
>> fi
>> --
>> 2.23.0
next prev parent reply other threads:[~2022-01-27 3:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 5:13 [PATCH v2] xfs/126: Add a getxattr opeartion after corrupted xattr Yang Xu
2021-11-26 23:28 ` Darrick J. Wong
2022-01-06 1:41 ` xuyang2018.jy
2022-01-17 8:22 ` [PATCH v3] xfs/12[4-6]: Add getfattr operation after xattr corrupted Yang Xu
2022-01-23 13:09 ` Eryu Guan
2022-01-27 3:02 ` xuyang2018.jy [this message]
2022-01-27 4:59 ` Zorro Lang
2022-01-30 2:44 ` xuyang2018.jy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=61F20B74.1090008@fujitsu.com \
--to=xuyang2018.jy@fujitsu.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=guan@eryu.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).