* [PATCH] Fstest: ext4: regression test for a ENOSPC warning @ 2018-11-02 2:19 ` Liu Bo 0 siblings, 0 replies; 4+ messages in thread From: Liu Bo @ 2018-11-02 2:19 UTC (permalink / raw) To: fstests; +Cc: linux-ext4 This adds a regression test for a ENOSPC warning which can be triggered if '-odioread_nolock,nodelalloc' and quota are used. The bug was fixed by patch "Ext4: fix ENOSPC when both quota and dioread_nolock are enabled". Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com> --- tests/ext4/034 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/ext4/034.out | 17 +++++++++++++ tests/ext4/group | 1 + 3 files changed, 93 insertions(+) create mode 100755 tests/ext4/034 create mode 100644 tests/ext4/034.out diff --git a/tests/ext4/034 b/tests/ext4/034 new file mode 100755 index 00000000..2449c3b7 --- /dev/null +++ b/tests/ext4/034 @@ -0,0 +1,75 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2018 Liu Bo, Alibaba. All Rights Reserved. +# +# FS QA Test 034 +# +# Regression test for a ENOSPC warning when both quota and +# "-o dioread_nolock,nodelalloc" is used. +# +# The bug was fixed by commit +# "Ext4: fix ENOSPC when both quota and dioread_nolock are enabled" +# +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/quota + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +# Modify as appropriate. +_supported_fs generic +_supported_os Linux +_require_scratch +_require_quota +_require_nobody + +echo "Format and mount" +_scratch_mkfs "-O quota" > $seqres.full 2>&1 +_scratch_mount "-o dioread_nolock,nodelalloc" > $seqres.full 2>&1 +quotaon $SCRATCH_MNT 2>/dev/null + +echo "Create the original file" +touch $SCRATCH_MNT/foobar >> $seqres.full +chown nobody $SCRATCH_MNT/foobar >> $seqres.full + +quotaon $SCRATCH_MNT 2>/dev/null +echo "Set hard quota" +setquota -u nobody 0 10M 0 0 $SCRATCH_MNT +_report_quota_blocks $SCRATCH_MNT + +echo "Create 2 level extent tree (btree) for foobar with a unwritten extent" +$XFS_IO_PROG -f -c "pwrite 0 4k" -c "falloc 4k 4k" -c "pwrite 8k 4k" -c "pwrite 20k 4k" -c "pwrite 28k 4k" -c "pwrite 36k 4k" -c "fsync" $SCRATCH_MNT/foobar >> $seqres.full + +xfs_io -c "fiemap -v" $SCRATCH_MNT/foobar >> $seqres.full + +echo "Convert unwritten extent to written and collapse extent tree to inode" +$XFS_IO_PROG -c "pwrite 4k 4k" $SCRATCH_MNT/foobar >> $seqres.full + +echo "Create a new file and do fsync to force a jbd2 commit" +$XFS_IO_PROG -f -c "pwrite 0 4k" -c "fsync" $SCRATCH_MNT/dummy >> $seqres.full + +echo "sync $SCRATCH_MNT to writeback" +$XFS_IO_PROG -c "syncfs" $SCRATCH_MNT >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/ext4/034.out b/tests/ext4/034.out new file mode 100644 index 00000000..dd0c8a7c --- /dev/null +++ b/tests/ext4/034.out @@ -0,0 +1,17 @@ +QA output created by 034 +Format and mount +Create the original file +Set hard quota +root 20 0 0 +nobody 0 0 10240 +User soft hard grace +Block time: 7days; Inode +Block File limits +---------------------------------------------------------------------- +*** for user quotas + + +Create 2 level extent tree (btree) for foobar with a unwritten extent +Convert unwritten extent to written and collapse extent tree to inode +Create a new file and do fsync to force a jbd2 commit +sync /mnt/scratch to writeback diff --git a/tests/ext4/group b/tests/ext4/group index b850f568..eb744a12 100644 --- a/tests/ext4/group +++ b/tests/ext4/group @@ -36,6 +36,7 @@ 031 auto quick dax 032 auto quick ioctl resize 033 auto ioctl resize +034 auto quick quota 271 auto rw quick 301 aio auto ioctl rw stress defrag 302 aio auto ioctl rw stress defrag -- 2.14.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] Fstest: ext4: regression test for a ENOSPC warning @ 2018-11-02 2:19 ` Liu Bo 0 siblings, 0 replies; 4+ messages in thread From: Liu Bo @ 2018-11-02 2:19 UTC (permalink / raw) To: fstests; +Cc: linux-ext4 This adds a regression test for a ENOSPC warning which can be triggered if '-odioread_nolock,nodelalloc' and quota are used. The bug was fixed by patch "Ext4: fix ENOSPC when both quota and dioread_nolock are enabled". Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com> --- tests/ext4/034 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/ext4/034.out | 17 +++++++++++++ tests/ext4/group | 1 + 3 files changed, 93 insertions(+) create mode 100755 tests/ext4/034 create mode 100644 tests/ext4/034.out diff --git a/tests/ext4/034 b/tests/ext4/034 new file mode 100755 index 00000000..2449c3b7 --- /dev/null +++ b/tests/ext4/034 @@ -0,0 +1,75 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2018 Liu Bo, Alibaba. All Rights Reserved. +# +# FS QA Test 034 +# +# Regression test for a ENOSPC warning when both quota and +# "-o dioread_nolock,nodelalloc" is used. +# +# The bug was fixed by commit +# "Ext4: fix ENOSPC when both quota and dioread_nolock are enabled" +# +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/quota + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +# Modify as appropriate. +_supported_fs generic +_supported_os Linux +_require_scratch +_require_quota +_require_nobody + +echo "Format and mount" +_scratch_mkfs "-O quota" > $seqres.full 2>&1 +_scratch_mount "-o dioread_nolock,nodelalloc" > $seqres.full 2>&1 +quotaon $SCRATCH_MNT 2>/dev/null + +echo "Create the original file" +touch $SCRATCH_MNT/foobar >> $seqres.full +chown nobody $SCRATCH_MNT/foobar >> $seqres.full + +quotaon $SCRATCH_MNT 2>/dev/null +echo "Set hard quota" +setquota -u nobody 0 10M 0 0 $SCRATCH_MNT +_report_quota_blocks $SCRATCH_MNT + +echo "Create 2 level extent tree (btree) for foobar with a unwritten extent" +$XFS_IO_PROG -f -c "pwrite 0 4k" -c "falloc 4k 4k" -c "pwrite 8k 4k" -c "pwrite 20k 4k" -c "pwrite 28k 4k" -c "pwrite 36k 4k" -c "fsync" $SCRATCH_MNT/foobar >> $seqres.full + +xfs_io -c "fiemap -v" $SCRATCH_MNT/foobar >> $seqres.full + +echo "Convert unwritten extent to written and collapse extent tree to inode" +$XFS_IO_PROG -c "pwrite 4k 4k" $SCRATCH_MNT/foobar >> $seqres.full + +echo "Create a new file and do fsync to force a jbd2 commit" +$XFS_IO_PROG -f -c "pwrite 0 4k" -c "fsync" $SCRATCH_MNT/dummy >> $seqres.full + +echo "sync $SCRATCH_MNT to writeback" +$XFS_IO_PROG -c "syncfs" $SCRATCH_MNT >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/ext4/034.out b/tests/ext4/034.out new file mode 100644 index 00000000..dd0c8a7c --- /dev/null +++ b/tests/ext4/034.out @@ -0,0 +1,17 @@ +QA output created by 034 +Format and mount +Create the original file +Set hard quota +root 20 0 0 +nobody 0 0 10240 +User soft hard grace +Block time: 7days; Inode +Block File limits +---------------------------------------------------------------------- +*** for user quotas + + +Create 2 level extent tree (btree) for foobar with a unwritten extent +Convert unwritten extent to written and collapse extent tree to inode +Create a new file and do fsync to force a jbd2 commit +sync /mnt/scratch to writeback diff --git a/tests/ext4/group b/tests/ext4/group index b850f568..eb744a12 100644 --- a/tests/ext4/group +++ b/tests/ext4/group @@ -36,6 +36,7 @@ 031 auto quick dax 032 auto quick ioctl resize 033 auto ioctl resize +034 auto quick quota 271 auto rw quick 301 aio auto ioctl rw stress defrag 302 aio auto ioctl rw stress defrag -- 2.14.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fstest: ext4: regression test for a ENOSPC warning 2018-11-02 2:19 ` Liu Bo (?) @ 2018-11-03 9:42 ` Eryu Guan 2018-11-07 2:56 ` Liu Bo -1 siblings, 1 reply; 4+ messages in thread From: Eryu Guan @ 2018-11-03 9:42 UTC (permalink / raw) To: Liu Bo; +Cc: fstests, linux-ext4 On Fri, Nov 02, 2018 at 10:19:25AM +0800, Liu Bo wrote: > This adds a regression test for a ENOSPC warning which can be triggered if > '-odioread_nolock,nodelalloc' and quota are used. > > The bug was fixed by patch > "Ext4: fix ENOSPC when both quota and dioread_nolock are enabled". > > Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com> > --- > tests/ext4/034 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/ext4/034.out | 17 +++++++++++++ > tests/ext4/group | 1 + > 3 files changed, 93 insertions(+) > create mode 100755 tests/ext4/034 > create mode 100644 tests/ext4/034.out > > diff --git a/tests/ext4/034 b/tests/ext4/034 > new file mode 100755 > index 00000000..2449c3b7 > --- /dev/null > +++ b/tests/ext4/034 > @@ -0,0 +1,75 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2018 Liu Bo, Alibaba. All Rights Reserved. > +# > +# FS QA Test 034 > +# > +# Regression test for a ENOSPC warning when both quota and > +# "-o dioread_nolock,nodelalloc" is used. > +# > +# The bug was fixed by commit > +# "Ext4: fix ENOSPC when both quota and dioread_nolock are enabled" > +# > +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/quota > + > +# remove previous $seqres.full before test > +rm -f $seqres.full > + > +# real QA test starts here > + > +# Modify as appropriate. > +_supported_fs generic _supported_fs ext4 > +_supported_os Linux > +_require_scratch > +_require_quota > +_require_nobody > + > +echo "Format and mount" > +_scratch_mkfs "-O quota" > $seqres.full 2>&1 This needs a require rule to check quota feature support status, i.e. _require_scratch_ext4_feature "quota" > +_scratch_mount "-o dioread_nolock,nodelalloc" > $seqres.full 2>&1 > +quotaon $SCRATCH_MNT 2>/dev/null And given that "quota" feature is enabled, quota is turned on automatically on mount, seems there's no need to do quotaon. > + > +echo "Create the original file" > +touch $SCRATCH_MNT/foobar >> $seqres.full > +chown nobody $SCRATCH_MNT/foobar >> $seqres.full > + > +quotaon $SCRATCH_MNT 2>/dev/null Duplicated quotaon? > +echo "Set hard quota" > +setquota -u nobody 0 10M 0 0 $SCRATCH_MNT > +_report_quota_blocks $SCRATCH_MNT Looks like this is not needed either, if it's only for debug purpose just dump the output to $seqres.full > + > +echo "Create 2 level extent tree (btree) for foobar with a unwritten extent" > +$XFS_IO_PROG -f -c "pwrite 0 4k" -c "falloc 4k 4k" -c "pwrite 8k 4k" -c "pwrite 20k 4k" -c "pwrite 28k 4k" -c "pwrite 36k 4k" -c "fsync" $SCRATCH_MNT/foobar >> $seqres.full Too long line, wrap it :) > + > +xfs_io -c "fiemap -v" $SCRATCH_MNT/foobar >> $seqres.full $XFS_IO_PROG > + > +echo "Convert unwritten extent to written and collapse extent tree to inode" > +$XFS_IO_PROG -c "pwrite 4k 4k" $SCRATCH_MNT/foobar >> $seqres.full > + > +echo "Create a new file and do fsync to force a jbd2 commit" > +$XFS_IO_PROG -f -c "pwrite 0 4k" -c "fsync" $SCRATCH_MNT/dummy >> $seqres.full > + > +echo "sync $SCRATCH_MNT to writeback" > +$XFS_IO_PROG -c "syncfs" $SCRATCH_MNT >> $seqres.full syncfs needs _require_xfs_io_command "syncfs" Perhaps _scratch_unmount or just sync to trigger the writeback? Thanks, Eryu > + > +# success, all done > +status=0 > +exit > diff --git a/tests/ext4/034.out b/tests/ext4/034.out > new file mode 100644 > index 00000000..dd0c8a7c > --- /dev/null > +++ b/tests/ext4/034.out > @@ -0,0 +1,17 @@ > +QA output created by 034 > +Format and mount > +Create the original file > +Set hard quota > +root 20 0 0 > +nobody 0 0 10240 > +User soft hard grace > +Block time: 7days; Inode > +Block File limits > +---------------------------------------------------------------------- > +*** for user quotas > + > + > +Create 2 level extent tree (btree) for foobar with a unwritten extent > +Convert unwritten extent to written and collapse extent tree to inode > +Create a new file and do fsync to force a jbd2 commit > +sync /mnt/scratch to writeback > diff --git a/tests/ext4/group b/tests/ext4/group > index b850f568..eb744a12 100644 > --- a/tests/ext4/group > +++ b/tests/ext4/group > @@ -36,6 +36,7 @@ > 031 auto quick dax > 032 auto quick ioctl resize > 033 auto ioctl resize > +034 auto quick quota > 271 auto rw quick > 301 aio auto ioctl rw stress defrag > 302 aio auto ioctl rw stress defrag > -- > 2.14.2 > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fstest: ext4: regression test for a ENOSPC warning 2018-11-03 9:42 ` Eryu Guan @ 2018-11-07 2:56 ` Liu Bo 0 siblings, 0 replies; 4+ messages in thread From: Liu Bo @ 2018-11-07 2:56 UTC (permalink / raw) To: Eryu Guan; +Cc: fstests, linux-ext4 Hi, On Sat, Nov 03, 2018 at 05:42:01PM +0800, Eryu Guan wrote: > On Fri, Nov 02, 2018 at 10:19:25AM +0800, Liu Bo wrote: > > This adds a regression test for a ENOSPC warning which can be triggered if > > '-odioread_nolock,nodelalloc' and quota are used. > > > > The bug was fixed by patch > > "Ext4: fix ENOSPC when both quota and dioread_nolock are enabled". > > > > Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com> > > --- > > tests/ext4/034 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > tests/ext4/034.out | 17 +++++++++++++ > > tests/ext4/group | 1 + > > 3 files changed, 93 insertions(+) > > create mode 100755 tests/ext4/034 > > create mode 100644 tests/ext4/034.out > > > > diff --git a/tests/ext4/034 b/tests/ext4/034 > > new file mode 100755 > > index 00000000..2449c3b7 > > --- /dev/null > > +++ b/tests/ext4/034 > > @@ -0,0 +1,75 @@ > > +#! /bin/bash > > +# SPDX-License-Identifier: GPL-2.0 > > +# Copyright (c) 2018 Liu Bo, Alibaba. All Rights Reserved. > > +# > > +# FS QA Test 034 > > +# > > +# Regression test for a ENOSPC warning when both quota and > > +# "-o dioread_nolock,nodelalloc" is used. > > +# > > +# The bug was fixed by commit > > +# "Ext4: fix ENOSPC when both quota and dioread_nolock are enabled" > > +# > > +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/quota > > + > > +# remove previous $seqres.full before test > > +rm -f $seqres.full > > + > > +# real QA test starts here > > + > > +# Modify as appropriate. > > +_supported_fs generic > > _supported_fs ext4 > OK. > > +_supported_os Linux > > +_require_scratch > > +_require_quota > > +_require_nobody > > + > > +echo "Format and mount" > > +_scratch_mkfs "-O quota" > $seqres.full 2>&1 > > This needs a require rule to check quota feature support status, i.e. > > _require_scratch_ext4_feature "quota" > OK. > > +_scratch_mount "-o dioread_nolock,nodelalloc" > $seqres.full 2>&1 > > +quotaon $SCRATCH_MNT 2>/dev/null > > And given that "quota" feature is enabled, quota is turned on > automatically on mount, seems there's no need to do quotaon. > I see, will confirm it. > > + > > +echo "Create the original file" > > +touch $SCRATCH_MNT/foobar >> $seqres.full > > +chown nobody $SCRATCH_MNT/foobar >> $seqres.full > > + > > +quotaon $SCRATCH_MNT 2>/dev/null > > Duplicated quotaon? > OK. > > +echo "Set hard quota" > > +setquota -u nobody 0 10M 0 0 $SCRATCH_MNT > > +_report_quota_blocks $SCRATCH_MNT > > Looks like this is not needed either, if it's only for debug purpose > just dump the output to $seqres.full > Make sense. > > + > > +echo "Create 2 level extent tree (btree) for foobar with a unwritten extent" > > +$XFS_IO_PROG -f -c "pwrite 0 4k" -c "falloc 4k 4k" -c "pwrite 8k 4k" -c "pwrite 20k 4k" -c "pwrite 28k 4k" -c "pwrite 36k 4k" -c "fsync" $SCRATCH_MNT/foobar >> $seqres.full > > Too long line, wrap it :) > OK. > > + > > +xfs_io -c "fiemap -v" $SCRATCH_MNT/foobar >> $seqres.full > > $XFS_IO_PROG > OK. > > + > > +echo "Convert unwritten extent to written and collapse extent tree to inode" > > +$XFS_IO_PROG -c "pwrite 4k 4k" $SCRATCH_MNT/foobar >> $seqres.full > > + > > +echo "Create a new file and do fsync to force a jbd2 commit" > > +$XFS_IO_PROG -f -c "pwrite 0 4k" -c "fsync" $SCRATCH_MNT/dummy >> $seqres.full > > + > > +echo "sync $SCRATCH_MNT to writeback" > > +$XFS_IO_PROG -c "syncfs" $SCRATCH_MNT >> $seqres.full > > syncfs needs > > _require_xfs_io_command "syncfs" > > Perhaps _scratch_unmount or just sync to trigger the writeback? > 'sync' should be fine. Thank you so much for the comments, I'll update the patch. thanks, -liubo > Thanks, > Eryu > > > + > > +# success, all done > > +status=0 > > +exit > > diff --git a/tests/ext4/034.out b/tests/ext4/034.out > > new file mode 100644 > > index 00000000..dd0c8a7c > > --- /dev/null > > +++ b/tests/ext4/034.out > > @@ -0,0 +1,17 @@ > > +QA output created by 034 > > +Format and mount > > +Create the original file > > +Set hard quota > > +root 20 0 0 > > +nobody 0 0 10240 > > +User soft hard grace > > +Block time: 7days; Inode > > +Block File limits > > +---------------------------------------------------------------------- > > +*** for user quotas > > + > > + > > +Create 2 level extent tree (btree) for foobar with a unwritten extent > > +Convert unwritten extent to written and collapse extent tree to inode > > +Create a new file and do fsync to force a jbd2 commit > > +sync /mnt/scratch to writeback > > diff --git a/tests/ext4/group b/tests/ext4/group > > index b850f568..eb744a12 100644 > > --- a/tests/ext4/group > > +++ b/tests/ext4/group > > @@ -36,6 +36,7 @@ > > 031 auto quick dax > > 032 auto quick ioctl resize > > 033 auto ioctl resize > > +034 auto quick quota > > 271 auto rw quick > > 301 aio auto ioctl rw stress defrag > > 302 aio auto ioctl rw stress defrag > > -- > > 2.14.2 > > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-07 12:25 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-11-02 2:19 [PATCH] Fstest: ext4: regression test for a ENOSPC warning Liu Bo 2018-11-02 2:19 ` Liu Bo 2018-11-03 9:42 ` Eryu Guan 2018-11-07 2:56 ` Liu Bo
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.