Re: [PATCH] generic: add test for XFS forkoff miscalcution on 32-bit platform

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



Hi Eryu,

On Sun, Nov 22, 2020 at 10:46:33PM +0800, Eryu Guan wrote:
> On Wed, Nov 18, 2020 at 02:02:58PM +0800, Gao Xiang wrote:

...

> > +# xxxxxxxxxxxx ("xfs: fix forkoff miscalculation related to XFS_LITINO(mp)")
> 
> Would you please re-post when the commit is upstream? With the commit ID
> updated.

Sure will definitely do tomorrow.

> 
> > +
> > +seq=`basename $0`
> > +seqres=$RESULT_DIR/$seq
> > +echo "QA output created by $seq"
> > +
> > +here=`pwd`
> > +tmp=/tmp/$$
> > +status=1	# failure is the default!
> > +trap "_cleanup; exit \$status" 0 1 2 3 15
> > +
> > +_cleanup()
> > +{
> > +	cd /
> > +	rm -f $tmp.*
> > +}
> > +
> > +# get standard environment, filters and checks
> > +. ./common/rc
> > +. ./common/filter
> > +. ./common/attr
> > +
> > +# remove previous $seqres.full before test
> > +rm -f $seqres.full
> > +
> > +# real QA test starts here
> > +
> > +_supported_fs generic
> > +_require_test
> > +_require_attrs user
> > +
> > +localfile="${TEST_DIR}/testfile"
> 
> Usually we use a testfile prefixed with $seq, e.g.
> 
> localfile=${TEST_DIR}/$seq.testfile
> 
> And remove it before test to avoid side effects from previous runs.
> 
> rm -f $localfile
> touch $localfile

okay, will fix.

Actually I didn't take much time on this (just copy from
generic/611 and use $TEST_DIR instead.) 

> 
> > +
> > +touch "${localfile}"
> > +"${SETFATTR_PROG}" -n user.0 -v "`seq 0 80`" "${localfile}"
> > +"${SETFATTR_PROG}" -n user.1 -v "`seq 0 80`" "${localfile}"
> 
> I'd be better to add comments on why we need two user attrs and why we
> need such long attr value.

There is no specific reason of using "user attrs" and this
combination, just the example in
commit ada49d64fb35 ("xfs: fix forkoff miscalculation related to XFS_LITINO(mp)")

long xattrs which acrosses inline xattr shortform fork can
trigger this issue. As I said in the patch, the bug itself
is xfs-specific, but the testcase is generic.

> 
> > +
> > +# Make sure that changes are written to disk
> > +_test_cycle_mount
> > +
> > +# check getfattr result as well
> 
> Also, better to document the test failure behavior, e.g. kernel crash or
> hung or just a getfattr failure.

It depends, since ASSERT already fails in the second setfattr
and similar as
https://bugzilla.redhat.com/show_bug.cgi?id=1894177

if CONFIG_XFS_ASSERT_FATAL=n, what I saw was that hung on
the _getfattr line. But in any case, _getfattr won't success
with the correct result. So I don't think it needs to document
such unstable status.

Thanks,
Gao Xiang

> 
> Thanks,
> Eryu
> 
> > +_getfattr --absolute-names -ebase64 -d $localfile | tail -n +2 | sort
> > +
> > +status=0
> > +exit
> > diff --git a/tests/generic/618.out b/tests/generic/618.out
> > new file mode 100644
> > index 00000000..848fdc58
> > --- /dev/null
> > +++ b/tests/generic/618.out
> > @@ -0,0 +1,4 @@
> > +QA output created by 618
> > +
> > +user.0=0sMAoxCjIKMwo0CjUKNgo3CjgKOQoxMAoxMQoxMgoxMwoxNAoxNQoxNgoxNwoxOAoxOQoyMAoyMQoyMgoyMwoyNAoyNQoyNgoyNwoyOAoyOQozMAozMQozMgozMwozNAozNQozNgozNwozOAozOQo0MAo0MQo0Mgo0Mwo0NAo0NQo0Ngo0Nwo0OAo0OQo1MAo1MQo1Mgo1Mwo1NAo1NQo1Ngo1Nwo1OAo1OQo2MAo2MQo2Mgo2Mwo2NAo2NQo2Ngo2Nwo2OAo2OQo3MAo3MQo3Mgo3Mwo3NAo3NQo3Ngo3Nwo3OAo3OQo4MA==
> > +user.1=0sMAoxCjIKMwo0CjUKNgo3CjgKOQoxMAoxMQoxMgoxMwoxNAoxNQoxNgoxNwoxOAoxOQoyMAoyMQoyMgoyMwoyNAoyNQoyNgoyNwoyOAoyOQozMAozMQozMgozMwozNAozNQozNgozNwozOAozOQo0MAo0MQo0Mgo0Mwo0NAo0NQo0Ngo0Nwo0OAo0OQo1MAo1MQo1Mgo1Mwo1NAo1NQo1Ngo1Nwo1OAo1OQo2MAo2MQo2Mgo2Mwo2NAo2NQo2Ngo2Nwo2OAo2OQo3MAo3MQo3Mgo3Mwo3NAo3NQo3Ngo3Nwo3OAo3OQo4MA==
> > diff --git a/tests/generic/group b/tests/generic/group
> > index 94e860b8..eca9d619 100644
> > --- a/tests/generic/group
> > +++ b/tests/generic/group
> > @@ -620,3 +620,4 @@
> >  615 auto rw
> >  616 auto rw io_uring stress
> >  617 auto rw io_uring stress
> > +618 auto quick attr
> > -- 
> > 2.18.4
> 




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux