FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH 1/2] generic/740: set env for mkfs.exfat
@ 2026-06-18 19:22 David Timber
  2026-06-18 19:22 ` [PATCH 2/2] generic/740: add --force option to mkfs.ntfs David Timber
  2026-06-19  4:53 ` [PATCH 1/2] generic/740: set env for mkfs.exfat Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: David Timber @ 2026-06-18 19:22 UTC (permalink / raw)
  To: Zorro Lang, Darrick J. Wong, Christoph Hellwig; +Cc: fstests, David Timber

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] generic/740: add --force option to mkfs.ntfs
  2026-06-18 19:22 [PATCH 1/2] generic/740: set env for mkfs.exfat David Timber
@ 2026-06-18 19:22 ` David Timber
  2026-06-19  4:53   ` Christoph Hellwig
  2026-06-19  4:53 ` [PATCH 1/2] generic/740: set env for mkfs.exfat Christoph Hellwig
  1 sibling, 1 reply; 4+ messages in thread
From: David Timber @ 2026-06-18 19:22 UTC (permalink / raw)
  To: Zorro Lang, Darrick J. Wong, Christoph Hellwig; +Cc: fstests, David Timber

mkntfs refuses to format the target if it's backed by a "real" device
but not a partition to maintain compatibility with Windows. When
formatting the scratch device in NTFS for testing, this behaviour has
to be overridden so that any type of blockdev can be used as a scratch
device.

Signed-off-by: David Timber <dxdt@dev.snart.me>
---
 tests/generic/740 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/generic/740 b/tests/generic/740
index 4f8bf099..718d983d 100755
--- a/tests/generic/740
+++ b/tests/generic/740
@@ -72,8 +72,10 @@ do
 		postargs=2000
 		;;
 	ntfs)
-		# "quick" format that doesn't zero the entire device
-		postargs="--quick"
+		# "quick" format that doesn't zero the entire device. Use -F so
+		# that NTFS-3G mkfs formats the volume even if the scratch
+		# blockdev is not a partition.
+		postargs="--quick --force"
 		;;
 	reiser4)
 		preop="echo y |"
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] generic/740: set env for mkfs.exfat
  2026-06-18 19:22 [PATCH 1/2] generic/740: set env for mkfs.exfat David Timber
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2026-06-19  4:53 UTC (permalink / raw)
  To: David Timber; +Cc: Zorro Lang, Darrick J. Wong, Christoph Hellwig, fstests

On Fri, Jun 19, 2026 at 04:22:35AM +0900, David Timber wrote:
> 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 \

breaking up the long line still would be nice here, i.e. keep at 80
characters.  Else looks good.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] generic/740: add --force option to mkfs.ntfs
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2026-06-19  4:53 UTC (permalink / raw)
  To: David Timber; +Cc: Zorro Lang, Darrick J. Wong, Christoph Hellwig, fstests

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-19  4:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 19:22 [PATCH 1/2] generic/740: set env for mkfs.exfat David Timber
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-19  4:53 ` [PATCH 1/2] generic/740: set env for mkfs.exfat Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox