From: David Timber <dxdt@dev.snart.me>
To: Zorro Lang <zlang@kernel.org>,
"Darrick J. Wong" <djwong@kernel.org>,
Christoph Hellwig <hch@lst.de>
Cc: fstests@vger.kernel.org, David Timber <dxdt@dev.snart.me>
Subject: [PATCH 1/2] generic/740: set env for mkfs.exfat
Date: Fri, 19 Jun 2026 04:22:35 +0900 [thread overview]
Message-ID: <20260618192236.654082-1-dxdt@dev.snart.me> (raw)
Foreign filesystem detection is added in exfatprogs version 1.4.1. To
maintain backward compatibility, mkfs.exfat refuses to format the device
only when it's run from terminal with a tty associated to it.
This is similar to how e2fsprogs work around the issue. However,
with exfatprogs, this behaviour can be overridden with the special
environment variable EXFAT_TTY_OVERRIDE to simulate shell invocation by
user.
Signed-off-by: David Timber <dxdt@dev.snart.me>
---
tests/generic/740 | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/tests/generic/740 b/tests/generic/740
index ce55200f..4f8bf099 100755
--- a/tests/generic/740
+++ b/tests/generic/740
@@ -28,6 +28,18 @@ _require_block_device "${SCRATCH_DEV}"
# not all the FS support zoned block device
_require_non_zoned_device "${SCRATCH_DEV}"
+mkfs_preop=""
+mkfs_preargs=""
+mkfs_postargs=""
+
+case "$FSTYP" in
+exfat)
+ # For backward compatibility, mkfs.exfat refuses to format only when run
+ # from a tty. This env var should override the behaviour if supported.
+ mkfs_preop="EXFAT_TTY_OVERRIDE=1"
+ ;;
+esac
+
echo "Silence is golden."
for fs in `echo ${MKFS_PROG}.* | sed -e "s:${MKFS_PROG}.::g"`
do
@@ -83,7 +95,8 @@ do
# next, ensure we don't overwrite it
echo "=== Attempting $FSTYP overwrite of $fs..." >>$seqres.full
- ${MKFS_PROG} -t $FSTYP $SCRATCH_DEV >>$seqres.full 2>&1
+ eval $mkfs_preop ${MKFS_PROG} -t $FSTYP $mkfs_preargs $SCRATCH_DEV $mkfs_postargs \
+ >>$seqres.full 2>&1
[ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
else
--
2.54.0
next reply other threads:[~2026-06-18 19:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 19:22 David Timber [this message]
2026-06-18 19:22 ` [PATCH 2/2] generic/740: add --force option to mkfs.ntfs David Timber
2026-06-19 4:53 ` Christoph Hellwig
2026-06-25 18:45 ` Darrick J. Wong
2026-06-19 4:53 ` [PATCH 1/2] generic/740: set env for mkfs.exfat Christoph Hellwig
2026-06-25 18:45 ` Darrick J. Wong
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=20260618192236.654082-1-dxdt@dev.snart.me \
--to=dxdt@dev.snart.me \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=hch@lst.de \
--cc=zlang@kernel.org \
/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.