diff mbox series

[4/6] generic/269: require no compression

Message ID ea5a2c054381fccd48bdf5dd987247a0c6bd55fe.1715896529.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series Btrfs test updates and fixups | expand

Commit Message

David Sterba May 16, 2024, 10:12 p.m. UTC
From: Josef Bacik <josef@toxicpanda.com>

This is meant to test ENOSPC, but we're dd'ing /dev/zero, which won't
fill up anything with compression on.

Additionally we're killing dd and then immediately trying to unmount.
With compression we could have references to the inode being held by the
async compression workers, so sometimes this will fail with EBUSY on the
unmount.

Make it easier on us and just skip this if we have compression enabled.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
 tests/generic/269 | 3 +++
 1 file changed, 3 insertions(+)

Comments

Anand Jain May 21, 2024, 12:37 a.m. UTC | #1
On 5/17/24 06:12, David Sterba wrote:
> From: Josef Bacik <josef@toxicpanda.com>
> 
> This is meant to test ENOSPC, but we're dd'ing /dev/zero, which won't
> fill up anything with compression on.
> 
> Additionally we're killing dd and then immediately trying to unmount.
> With compression we could have references to the inode being held by the
> async compression workers, so sometimes this will fail with EBUSY on the
> unmount.
> 
> Make it easier on us and just skip this if we have compression enabled.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>   tests/generic/269 | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/tests/generic/269 b/tests/generic/269
> index b7cdecd94f219a..6ee0cb04581632 100755
> --- a/tests/generic/269
> +++ b/tests/generic/269
> @@ -11,6 +11,9 @@ _begin_fstest auto rw prealloc ioctl enospc stress
>   
>   # Import common functions.
>   . ./common/filter
> +
> +_require_no_compress
> +
>   # Disable all sync operations to get higher load
>   FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
>   _workout()


Can we use _ddt to fill the file with partially compressible data?
On a laptop, with compression, it takes 63s (otherwise 45s).
If we're ok with this, I'll sort it out here. Git diff below.

Thanks, Anand


------
MOUNT_OPTIONS -- -o compress /dev/sdc1 /mnt/scratch

generic/269 45s ...  63s
Ran: generic/269
Passed all 1 tests
------


diff --git a/tests/generic/269 b/tests/generic/269
index b7cdecd94f21..29f453735fc2 100755
--- a/tests/generic/269
+++ b/tests/generic/269
@@ -29,7 +29,7 @@ _workout()
         for ((i=0; i < num_iterations; i++))
         do
                 # File will be opened with O_TRUNC each time
-               dd if=/dev/zero of=$SCRATCH_MNT/SPACE_CONSUMER bs=1M \
+               _ddt of=$SCRATCH_MNT/SPACE_CONSUMER bs=1M \
                         >> $seqres.full 2>&1
                 sleep $enospc_time
         done
David Sterba May 21, 2024, 6:29 p.m. UTC | #2
On Tue, May 21, 2024 at 08:37:48AM +0800, Anand Jain wrote:
> On 5/17/24 06:12, David Sterba wrote:
> > From: Josef Bacik <josef@toxicpanda.com>
> > 
> > This is meant to test ENOSPC, but we're dd'ing /dev/zero, which won't
> > fill up anything with compression on.
> > 
> > Additionally we're killing dd and then immediately trying to unmount.
> > With compression we could have references to the inode being held by the
> > async compression workers, so sometimes this will fail with EBUSY on the
> > unmount.
> > 
> > Make it easier on us and just skip this if we have compression enabled.
> > 
> > Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> > Signed-off-by: David Sterba <dsterba@suse.com>
> > ---
> >   tests/generic/269 | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/tests/generic/269 b/tests/generic/269
> > index b7cdecd94f219a..6ee0cb04581632 100755
> > --- a/tests/generic/269
> > +++ b/tests/generic/269
> > @@ -11,6 +11,9 @@ _begin_fstest auto rw prealloc ioctl enospc stress
> >   
> >   # Import common functions.
> >   . ./common/filter
> > +
> > +_require_no_compress
> > +
> >   # Disable all sync operations to get higher load
> >   FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
> >   _workout()
> 
> 
> Can we use _ddt to fill the file with partially compressible data?
> On a laptop, with compression, it takes 63s (otherwise 45s).
> If we're ok with this, I'll sort it out here. Git diff below.

Yeah the incompressible data would be better. According to the changelog
the async workers could block umount but I'm not sure this actually
happens, umount should wait until the IO is done and all inodes closed.
diff mbox series

Patch

diff --git a/tests/generic/269 b/tests/generic/269
index b7cdecd94f219a..6ee0cb04581632 100755
--- a/tests/generic/269
+++ b/tests/generic/269
@@ -11,6 +11,9 @@  _begin_fstest auto rw prealloc ioctl enospc stress
 
 # Import common functions.
 . ./common/filter
+
+_require_no_compress
+
 # Disable all sync operations to get higher load
 FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
 _workout()