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 v3] common/casefold: Support for tmpfs casefold test
Date: Mon, 11 Nov 2024 13:46:28 -0500 [thread overview]
Message-ID: <87o72lwquz.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20241109234618.29262-1-andrealmeid@igalia.com> ("André Almeida"'s message of "Sat, 9 Nov 2024 20:46:18 -0300")
André Almeida <andrealmeid@igalia.com> writes:
> Test casefold support for tmpfs.
>
> Signed-off-by: André Almeida <andrealmeid@igalia.com>
> ---
> common/casefold | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> common/rc | 3 +++
> tests/generic/556 | 12 ++++++++----
> 3 files changed, 57 insertions(+), 4 deletions(-)
>
> diff --git a/common/casefold b/common/casefold
> index d9126f4c..2aae5e5e 100644
> --- a/common/casefold
> +++ b/common/casefold
> @@ -12,6 +12,9 @@ _has_casefold_kernel_support()
> f2fs)
> test -f '/sys/fs/f2fs/features/casefold'
> ;;
> + tmpfs)
> + test -f '/sys/fs/tmpfs/features/casefold'
> + ;;
> *)
> # defaults to unsupported
> false
> @@ -52,6 +55,9 @@ _scratch_mkfs_casefold()
> f2fs)
> _scratch_mkfs -C utf8 $*
> ;;
> + tmpfs)
> + # there's no mkfs for tmpfs, just return
> + ;;
> *)
> _notrun "Don't know how to mkfs with casefold support on $FSTYP"
> ;;
> @@ -67,12 +73,52 @@ _scratch_mkfs_casefold_strict()
> f2fs)
> _scratch_mkfs -C utf8:strict
> ;;
> + tmpfs)
> + # there's no mkfs for tmpfs, just return
> + ;;
> *)
> _notrun "Don't know how to mkfs with casefold-strict support on $FSTYP"
> ;;
> esac
> }
>
> +_scratch_mount_casefold()
> +{
> + case $FSTYP in
> + ext4)
> + _scratch_mount
> + ;;
> + f2fs)
> + _scratch_mount
> + ;;
> + tmpfs)
> + mount -t tmpfs -o casefold tmpfs $SCRATCH_MNT
> + ;;
> + *)
> + _notrun "Don't know how to mount with casefold support on $FSTYP"
> + ;;
> + esac
> +}
> +
> +_scratch_mount_casefold_strict()
> +{
> + case $FSTYP in
> + ext4)
> + _scratch_mount
> + ;;
> + f2fs)
> + _scratch_mount
> + ;;
> + tmpfs)
> + mount -t tmpfs -o casefold,strict_encoding tmpfs $SCRATCH_MNT
> + ;;
> + *)
> + _notrun "Don't know how to mount with casefold support on $FSTYP"
> + ;;
> + esac
> +}
> +
Now, I noticed there is some infrastructure to provide mount options
through _scratch_mount_options that would be a better fit for this
instead of the custom handlers I previously suggested.
Either way, the test looks good to me:
Reviewed-by: Gabriel Krisman Bertazi <gabriel@krisman.be>
--
Gabriel Krisman Bertazi
prev parent reply other threads:[~2024-11-11 18:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-09 23:46 [PATCH v3] common/casefold: Support for tmpfs casefold test André Almeida
2024-11-11 18:46 ` Gabriel Krisman Bertazi [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=87o72lwquz.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox