From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
To: Eric Sandeen <sandeen@redhat.com>,
"fstests@vger.kernel.org" <fstests@vger.kernel.org>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Subject: Re: [PATCH] generic: test zero-byte writes to new file
Date: Fri, 21 Feb 2025 10:44:09 +0530 [thread overview]
Message-ID: <30dfe4a2d18ec2ca29d303c1f8fc943688221d59.camel@gmail.com> (raw)
In-Reply-To: <b4d76883-e58b-4db3-b7e4-7ddeb5ec7f42@redhat.com>
On Thu, 2025-02-13 at 12:06 -0600, Eric Sandeen wrote:
> A bug was recently fixed in exfat where attempting to do a zero-byte
> write would yield -EFAULT; test for that here.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> diff --git a/tests/generic/761 b/tests/generic/761
> new file mode 100755
> index 00000000..e933eb83
> --- /dev/null
> +++ b/tests/generic/761
> @@ -0,0 +1,28 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved.
> +#
> +# FS QA Test 761
> +#
> +# test zero-byte writes
> +#
> +# exfat had a regression where a zero-byte write to a file would
> +# yield -EfAULT. Should work on all filesystems - write should
> +# succeed and the zero-byte file should be created.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick
> +
> +[ "$FSTYP" = "exfat" ] && _fixed_by_kernel_commit dda0407a2026 \
> + "exfat: short-circuit zero-byte writes in
> exfat_file_write_iter"
> +
> +# Modify as appropriate.
> +_require_test
> +
> +rm -f $TEST_DIR/testfile.$seq
> +$XFS_IO_PROG -f -c "pwrite 0 0" $TEST_DIR/testfile.$seq
> +test -f $TEST_DIR/testfile.$seq || _fail "file not created"
Minor: Maybe just remove the test file that is created above (since we
are using the TEST_DIR)and not leave any test artifacts? Or, maybe use
the scratch device?
--NR
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/generic/761.out b/tests/generic/761.out
> new file mode 100644
> index 00000000..72ebba4c
> --- /dev/null
> +++ b/tests/generic/761.out
> @@ -0,0 +1,2 @@
> +QA output created by 761
> +Silence is golden
>
next prev parent reply other threads:[~2025-02-21 5:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 18:06 [PATCH] generic: test zero-byte writes to new file Eric Sandeen
2025-02-13 19:51 ` Darrick J. Wong
2025-02-13 20:50 ` Eric Sandeen
2025-02-14 3:17 ` Eric Sandeen
2025-02-14 4:02 ` Darrick J. Wong
2025-02-14 5:46 ` Namjae Jeon
2025-02-14 14:36 ` Eric Sandeen
2025-02-18 17:39 ` Darrick J. Wong
2025-02-21 16:07 ` Eric Sandeen
2025-02-21 5:14 ` Nirjhar Roy (IBM) [this message]
2025-02-21 16:47 ` Darrick J. Wong
2025-02-24 4:39 ` Nirjhar Roy (IBM)
2025-02-25 22:29 ` Eric Sandeen
2025-02-26 10:57 ` Zorro Lang
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=30dfe4a2d18ec2ca29d303c1f8fc943688221d59.camel@gmail.com \
--to=nirjhar.roy.lists@gmail.com \
--cc=fstests@vger.kernel.org \
--cc=linkinjeon@kernel.org \
--cc=sandeen@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