From: David Disseldorp <ddiss@suse.de>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: Anand Jain <anand.jain@oracle.com>, Zorro Lang <zlang@redhat.com>,
fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs/zoned: test premature ENOSPC because of reclaim being too slow
Date: Mon, 22 Jan 2024 23:25:38 +1100 [thread overview]
Message-ID: <20240122232538.2a2bbca1@echidna> (raw)
In-Reply-To: <20240122105554.1077035-1-johannes.thumshirn@wdc.com>
Hi Johannes,
On Mon, 22 Jan 2024 02:55:54 -0800, Johannes Thumshirn wrote:
> Add a test writing a file of 60% the drive size on a zoned btrfs and then
> overwriting the file again.
>
> On fast drives this will cause premature ENOSPC because the reclaim
> process isn't triggered fast enough.
>
> The kernel patch for this issue is:
> btrfs: zoned: wake up cleaner sooner if needed
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
> tests/btrfs/310 | 54 +++++++++++++++++++++++++++++++++++++++++++++
> tests/btrfs/310.out | 2 ++
> 2 files changed, 56 insertions(+)
> create mode 100755 tests/btrfs/310
> create mode 100644 tests/btrfs/310.out
>
> diff --git a/tests/btrfs/310 b/tests/btrfs/310
> new file mode 100755
> index 000000000000..6f6f5542f73f
> --- /dev/null
> +++ b/tests/btrfs/310
> @@ -0,0 +1,54 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2024 Western Digital Corporation. All Rights Reserved.
> +#
> +# FS QA Test 310
> +#
> +# Write a single file with 60% disk size to a zoned btrfs and then overwrite
> +# it again. On kernels without the fix this results in ENOSPC.
> +#
> +# This issue is fixed by the following kernel patch:
> +# btrfs: zoned: wake up cleaner sooner if needed
To-be-queued fixes are often flagged in the test via:
_fixed_by_kernel_commit XXXXXXXXXXXX \
"btrfs: zoned: wake up cleaner sooner if needed"
> +
> +. ./common/preamble
> +_begin_fstest auto enospc rw zone
> +
> +# real QA test starts here
> +
> +_supported_fs btrfs
I don't see anything btrfs specific here, aside from the actual bug
being triggered.
Would it make sense to move this to generic, or would that be a waste of
cycles for non-zone envs?
> +_require_scratch
> +_require_zoned_device "$SCRATCH_DEV"
> +
> +devsize=$(cat /sys/block/$(_short_dev $SCRATCH_DEV)/size)
> +devsize=$(expr $devsize \* 512)
> +filesize=$(expr $devsize \* 60 / 100)
> +
> +fio_config=$tmp.fio
> +
> +# Override the default cleanup function.
> +_cleanup()
> +{
> + rm -f $tmp.*
> +}
nit: looks like there's no need to override the default cleanup.
Test looks fine otherwise.
Cheers, David
next prev parent reply other threads:[~2024-01-22 12:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 10:55 [PATCH] btrfs/zoned: test premature ENOSPC because of reclaim being too slow Johannes Thumshirn
2024-01-22 12:25 ` David Disseldorp [this message]
2024-01-22 12:34 ` Johannes Thumshirn
2024-01-22 12:46 ` Filipe Manana
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=20240122232538.2a2bbca1@echidna \
--to=ddiss@suse.de \
--cc=anand.jain@oracle.com \
--cc=fstests@vger.kernel.org \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=zlang@redhat.com \
/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