All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <gabriel@krisman.be>
To: "André Almeida" <andrealmeid@igalia.com>
Cc: fstests@vger.kernel.org,  Zorro Lang <zlang@kernel.org>,
	kernel-dev@igalia.com,  Miklos Szeredi <mszeredi@redhat.com>,
	 Eryu Guan <guaneryu@gmail.com>,
	 "Darrick J . Wong" <djwong@kernel.org>
Subject: Re: [PATCH v2] common/casefold: Support for tmpfs casefold test
Date: Mon, 04 Nov 2024 16:45:37 -0500	[thread overview]
Message-ID: <875xp265by.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20241104210636.38934-1-andrealmeid@igalia.com> ("André Almeida"'s message of "Mon, 4 Nov 2024 18:06:36 -0300")

André Almeida <andrealmeid@igalia.com> writes:


> @@ -67,6 +74,10 @@ _scratch_mkfs_casefold_strict()
>  	f2fs)
>  		_scratch_mkfs -C utf8:strict
>  		;;
> +	tmpfs)
> +		# there's no mkfs for tmpfs, so we just mount it
> +		mount -t tmpfs -o casefold,strict_encoding tmpfs $SCRATCH_MNT
> +		;;


This looks like a hack.  Why mount it here instead of _scratch_mount?
This should just be a nop for tmpfs.


>  	*)
>  		_notrun "Don't know how to mkfs with casefold-strict support on $FSTYP"
>  		;;
> diff --git a/common/rc b/common/rc
> index 2af26f23..2ee46e51 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -374,6 +374,9 @@ _scratch_unmount()
>  	btrfs)
>  		$UMOUNT_PROG $SCRATCH_MNT
>  		;;
> +	tmpfs)
> +		$UMOUNT_PROG $SCRATCH_MNT
> +		;;
>  	*)
>  		$UMOUNT_PROG $SCRATCH_DEV
>  		;;
> diff --git a/tests/generic/556 b/tests/generic/556
> index 51d2d482..78cdf1bf 100755
> --- a/tests/generic/556
> +++ b/tests/generic/556
> @@ -485,11 +485,20 @@ test_strict_mode_invalid_filename()
>  
>  _scratch_mkfs_casefold >>$seqres.full 2>&1
>  
> -_scratch_mount
> -
> -_check_dmesg_for \
> -	"\(${sdev}\): Using encoding defined by superblock: utf8" || \
> -	_fail "Could not mount with encoding: utf8"
> +# casefold tmpfs was already mounted in the mkfs step
> +if [ "$FSTYP" != "tmpfs" ]; then
> +	_scratch_mount
> +fi

 can you fix _scratch_mount to correctly mount casefolded tmpfs?  if
not, provide a new local handler that will either call _scratch_mount
directly for !tmpfs or do the correct mount for tmpfs.

> +
> +if [ "$FSTYP" == "tmpfs" ]; then
> +	_check_dmesg_for \
> +		"tmpfs: Using encoding" || \
> +		_fail "Could not mount with encoding: utf8"
> +else
> +	_check_dmesg_for \
> +		"\(${sdev}\): Using encoding defined by superblock: utf8" || \
> +		_fail "Could not mount with encoding: utf8"
> +fi

Ugh. the kernel message should have been the same. Much better
than special casing the test.

>  
>  test_casefold_flag_basic
>  test_casefold_lookup
> @@ -517,7 +526,9 @@ _check_scratch_fs
>  
>  # Test Strict Mode
>  _scratch_mkfs_casefold_strict >>$seqres.full 2>&1
> -_scratch_mount
> +if [ "$FSTYP" != "tmpfs" ]; then
> +	_scratch_mount
> +fi
>  
>  test_strict_mode_invalid_filename

-- 
Gabriel Krisman Bertazi

  reply	other threads:[~2024-11-04 21:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04 21:06 [PATCH v2] common/casefold: Support for tmpfs casefold test André Almeida
2024-11-04 21:45 ` Gabriel Krisman Bertazi [this message]
2024-11-04 22:12   ` André Almeida
2024-11-04 22:44     ` Gabriel Krisman Bertazi

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=875xp265by.fsf@mailhost.krisman.be \
    --to=gabriel@krisman.be \
    --cc=andrealmeid@igalia.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=kernel-dev@igalia.com \
    --cc=mszeredi@redhat.com \
    --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.