From: Anna Schumaker <anna.schumaker@oracle.com>
To: Zorro Lang <zlang@redhat.com>, "Darrick J. Wong" <djwong@kernel.org>
Cc: Anna Schumaker <anna@kernel.org>,
linux-nfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH] generic/033: Check that the 'fzero' operations supports KEEP_SIZE
Date: Fri, 25 Apr 2025 11:22:12 -0400 [thread overview]
Message-ID: <937be37a-9c78-4bfd-adb4-7c401d3eb626@oracle.com> (raw)
In-Reply-To: <20250425114406.nybdc6witc33kiae@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>
On 4/25/25 7:44 AM, Zorro Lang wrote:
> On Thu, Apr 24, 2025 at 02:36:07PM -0700, Darrick J. Wong wrote:
>> On Thu, Apr 24, 2025 at 03:57:30PM -0400, Anna Schumaker wrote:
>>> From: Anna Schumaker <anna.schumaker@oracle.com>
>>>
>>> Otherwise this test will fail on filesystems that implement
>>> FALLOC_FL_ZERO_RANGE but not the optional FALLOC_FL_KEEP_SIZE flag.
>>>
>>> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
>>> ---
>>> tests/generic/033 | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tests/generic/033 b/tests/generic/033
>>> index a9a9ff5a3431..a33f6add67bf 100755
>>> --- a/tests/generic/033
>>> +++ b/tests/generic/033
>>> @@ -20,7 +20,7 @@ _begin_fstest auto quick rw zero
>>>
>>> # Modify as appropriate.
>>> _require_scratch
>>> -_require_xfs_io_command "fzero"
>>> +_require_xfs_io_command "fzero" "-k"
>>
>> I wonder, does this test even need KEEP_SIZE? It writes 64MB to the
>> file, then it fzeros every other 4k up to (64M-4k), then fzeroes
>> everything else. AFAICT the fzero commands never exceed the file
>> size...though I could be wrong.
>
> Hmm... I think you're right, the code logic is:
>
> bytes=$((64 * 1024))
> $XFS_IO_PROG -f -c "pwrite 0 $bytes" $file
> endoff=$((bytes - 4096))
> for i in $(seq 0 8192 $endoff); do
> $XFS_IO_PROG -c "fzero -k $i 4k" $file
> done
> for i in $(seq 4096 8192 $endoff); do
> $XFS_IO_PROG -c "fzero -k $i 4k" $file
> done
>
> So looks like the offset+len isn't greater than the file size. So we
> might can remove the "-k" directly. What do you think ?
I quickly tested this with my NFS ZERO_RANGE patch, and didn't have
any problems. I'll send a v2 removing the "-k" argument in a few
minutes!
Anna
>
> Thanks,
> Zorro
>
>>
>> --D
>>
>>>
>>> _scratch_mkfs >/dev/null 2>&1
>>> _scratch_mount
>>> --
>>> 2.49.0
>>>
>>>
>>
>
prev parent reply other threads:[~2025-04-25 15:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 19:57 [PATCH] generic/033: Check that the 'fzero' operations supports KEEP_SIZE Anna Schumaker
2025-04-24 21:36 ` Darrick J. Wong
2025-04-25 11:44 ` Zorro Lang
2025-04-25 15:22 ` Anna Schumaker [this message]
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=937be37a-9c78-4bfd-adb4-7c401d3eb626@oracle.com \
--to=anna.schumaker@oracle.com \
--cc=anna@kernel.org \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-nfs@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 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.