linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] tmpfs: Add case-insesitive support for tmpfs
@ 2024-08-23 17:33 André Almeida
  2024-08-23 17:33 ` [PATCH 1/5] tmpfs: Add casefold lookup support André Almeida
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: André Almeida @ 2024-08-23 17:33 UTC (permalink / raw)
  To: Hugh Dickins, Andrew Morton, Alexander Viro, Christian Brauner,
	Jan Kara
  Cc: linux-mm, linux-kernel, linux-fsdevel, kernel-dev, krisman,
	Daniel Rosenberg, smcv, André Almeida

Hi,

This series is based on [0].

This patchset adds support for case-insesitive file names lookups in tmpfs. The
main difference from other casefold filesystems is that tmpfs has no information
on disk, just on RAM, so we can't use mkfs to create a case-insensitive tmpfs.
For this implementation, I opted to have a mount option for casefolding. The
rest of the patchset follows a similar approach as ext4 and f2fs.

* Use case (from the original cover letter)

The use case for this feature is similar to the use case for ext4, to
better support compatibility layers (like Wine), particularly in
combination with sandboxing/container tools (like Flatpak). Those
containerization tools can share a subset of the host filesystem with an
application. In the container, the root directory and any parent
directories required for a shared directory are on tmpfs, with the
shared directories bind-mounted into the container's view of the
filesystem.

If the host filesystem is using case-insensitive directories, then the
application can do lookups inside those directories in a
case-insensitive way, without this needing to be implemented in
user-space. However, if the host is only sharing a subset of a
case-insensitive directory with the application, then the parent
directories of the mount point will be part of the container's root
tmpfs. When the application tries to do case-insensitive lookups of
those parent directories on a case-sensitive tmpfs, the lookup will
fail.

For example, if /srv/games is a case-insensitive directory on the host,
then applications will expect /srv/games/Steam/Half-Life and
/srv/games/steam/half-life to be interchangeable; but if the
container framework is only sharing /srv/games/Steam/Half-Life and
/srv/games/Steam/Portal (and not the rest of /srv/games) with the
container, with /srv, /srv/games and /srv/games/Steam as part of the
container's tmpfs root, then making /srv/games a case-insensitive
directory inside the container would be necessary to meet that
expectation.

* Testing

I send a patch for xfstests to enable the casefold test (generic/556) for tmpfs.[1]
The test succeed.

You can test this patchset using:

  sudo mount -t tmpfs -o casefold=utf8-12.1.0 tmpfs mnt/

And making a dir case-insesitive:

  mkdir mnt/dir
  chattr +F mnt/dir

[0] https://lore.kernel.org/linux-fsdevel/20210323195941.69720-1-andrealmeid@collabora.com/
[1] https://lore.kernel.org/fstests/20240823173008.280917-1-andrealmeid@igalia.com/

André Almeida (5):
  tmpfs: Add casefold lookup support
  tmpfs: Add flag FS_CASEFOLD_FL support for tmpfs dirs
  tmpfs: Create casefold mount options
  tmpfs: Expose filesystem features via sysfs
  docs: tmpfs: Add casefold options

 Documentation/filesystems/tmpfs.rst |  37 +++++
 include/linux/shmem_fs.h            |   7 +-
 mm/shmem.c                          | 205 ++++++++++++++++++++++++++--
 3 files changed, 238 insertions(+), 11 deletions(-)

-- 
2.46.0



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

* [PATCH 1/5] tmpfs: Add casefold lookup support
  2024-08-23 17:33 [PATCH 0/5] tmpfs: Add case-insesitive support for tmpfs André Almeida
@ 2024-08-23 17:33 ` André Almeida
  2024-08-26 19:16   ` Gabriel Krisman Bertazi
  2024-08-26 23:40   ` kernel test robot
  2024-08-23 17:33 ` [PATCH 2/5] tmpfs: Add flag FS_CASEFOLD_FL support for tmpfs dirs André Almeida
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 10+ messages in thread
From: André Almeida @ 2024-08-23 17:33 UTC (permalink / raw)
  To: Hugh Dickins, Andrew Morton, Alexander Viro, Christian Brauner,
	Jan Kara
  Cc: linux-mm, linux-kernel, linux-fsdevel, kernel-dev, krisman,
	Daniel Rosenberg, smcv, André Almeida

Enable casefold lookup in tmpfs, based on the enconding defined by
userspace. That means that instead of comparing byte per byte a file
name, it compares to a case-insensitive equivalent of the Unicode
string.

* dcache handling

There's a special need when dealing with case-insensitive dentries.
First of all, we currently invalidated every negative casefold dentries.
That happens because currently VFS code has no proper support to deal
with that, giving that it could incorrectly reuse a previous filename
for a new file that has a casefold match. For instance, this could
happen:

$ mkdir DIR
$ rm -r DIR
$ mkdir dir
$ ls
DIR/

And would be perceived as inconsistency from userspace point of view,
because even that we match files in a case-insensitive manner, we still
honor whatever is the initial filename.

Along with that, tmpfs stores only the first equivalent name dentry used
in the dcache, preventing duplications of dentries in the dcache. The
d_compare() version for casefold files stores a normalized string, and
before every lookup, the filename is normalized as well, achieving a
casefolded lookup.

Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
 include/linux/shmem_fs.h |  1 +
 mm/shmem.c               | 63 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 1d06b1e5408a..1a1196b077a6 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -73,6 +73,7 @@ struct shmem_sb_info {
 	struct list_head shrinklist;  /* List of shinkable inodes */
 	unsigned long shrinklist_len; /* Length of shrinklist */
 	struct shmem_quota_limits qlimits; /* Default quota limits */
+	bool casefold;
 };
 
 static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
diff --git a/mm/shmem.c b/mm/shmem.c
index 5a77acf6ac6a..aa272c62f811 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -40,6 +40,8 @@
 #include <linux/fs_parser.h>
 #include <linux/swapfile.h>
 #include <linux/iversion.h>
+#include <linux/unicode.h>
+#include <linux/parser.h>
 #include "swap.h"
 
 static struct vfsmount *shm_mnt __ro_after_init;
@@ -123,6 +125,8 @@ struct shmem_options {
 	bool noswap;
 	unsigned short quota_types;
 	struct shmem_quota_limits qlimits;
+	struct unicode_map *encoding;
+	bool strict_encoding;
 #define SHMEM_SEEN_BLOCKS 1
 #define SHMEM_SEEN_INODES 2
 #define SHMEM_SEEN_HUGE 4
@@ -3427,6 +3431,12 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir,
 	if (IS_ERR(inode))
 		return PTR_ERR(inode);
 
+#if IS_ENABLED(CONFIG_UNICODE)
+	if (sb_has_strict_encoding(dir->i_sb) && IS_CASEFOLDED(dir) &&
+	    dir->i_sb->s_encoding && utf8_validate(dir->i_sb->s_encoding, &dentry->d_name))
+		return -EINVAL;
+#endif
+
 	error = simple_acl_create(dir, inode);
 	if (error)
 		goto out_iput;
@@ -3435,6 +3445,9 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir,
 	if (error && error != -EOPNOTSUPP)
 		goto out_iput;
 
+	if (IS_CASEFOLDED(dir))
+		d_add(dentry, NULL);
+
 	error = simple_offset_add(shmem_get_offset_ctx(dir), dentry);
 	if (error)
 		goto out_iput;
@@ -3526,6 +3539,9 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir,
 		goto out;
 	}
 
+	if (IS_CASEFOLDED(dir))
+		d_add(dentry, NULL);
+
 	dir->i_size += BOGO_DIRENT_SIZE;
 	inode_set_mtime_to_ts(dir,
 			      inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode)));
@@ -3553,6 +3569,14 @@ static int shmem_unlink(struct inode *dir, struct dentry *dentry)
 	inode_inc_iversion(dir);
 	drop_nlink(inode);
 	dput(dentry);	/* Undo the count from "create" - does all the work */
+
+	/*
+	 * For now, VFS can't deal with case-insensitive negative dentries, so
+	 * we destroy them
+	 */
+	if (IS_CASEFOLDED(dir))
+		d_invalidate(dentry);
+
 	return 0;
 }
 
@@ -3697,6 +3721,8 @@ static int shmem_symlink(struct mnt_idmap *idmap, struct inode *dir,
 	dir->i_size += BOGO_DIRENT_SIZE;
 	inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
 	inode_inc_iversion(dir);
+	if (IS_CASEFOLDED(dir))
+		d_add(dentry, NULL);
 	d_instantiate(dentry, inode);
 	dget(dentry);
 	return 0;
@@ -4471,6 +4497,11 @@ static void shmem_put_super(struct super_block *sb)
 {
 	struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
 
+#if IS_ENABLED(CONFIG_UNICODE)
+	if (sbinfo->casefold)
+		utf8_unload(sb->s_encoding);
+#endif
+
 #ifdef CONFIG_TMPFS_QUOTA
 	shmem_disable_quotas(sb);
 #endif
@@ -4515,6 +4546,17 @@ static int shmem_fill_super(struct super_block *sb, struct fs_context *fc)
 	}
 	sb->s_export_op = &shmem_export_ops;
 	sb->s_flags |= SB_NOSEC | SB_I_VERSION;
+
+#if IS_ENABLED(CONFIG_UNICODE)
+	if (ctx->encoding) {
+		sb->s_encoding = ctx->encoding;
+		generic_set_sb_d_ops(sb);
+		if (ctx->strict_encoding)
+			sb->s_encoding_flags = SB_ENC_STRICT_MODE_FL;
+		sbinfo->casefold = true;
+	}
+#endif
+
 #else
 	sb->s_flags |= SB_NOUSER;
 #endif
@@ -4704,11 +4746,28 @@ static const struct inode_operations shmem_inode_operations = {
 #endif
 };
 
+static struct dentry *shmem_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
+{
+	if (dentry->d_name.len > NAME_MAX)
+		return ERR_PTR(-ENAMETOOLONG);
+
+	/*
+	 * For now, VFS can't deal with case-insensitive negative dentries, so
+	 * we prevent them from being created
+	 */
+	if (IS_CASEFOLDED(dir))
+		return NULL;
+
+	d_add(dentry, NULL);
+
+	return NULL;
+}
+
 static const struct inode_operations shmem_dir_inode_operations = {
 #ifdef CONFIG_TMPFS
 	.getattr	= shmem_getattr,
 	.create		= shmem_create,
-	.lookup		= simple_lookup,
+	.lookup		= shmem_lookup,
 	.link		= shmem_link,
 	.unlink		= shmem_unlink,
 	.symlink	= shmem_symlink,
@@ -4791,6 +4850,8 @@ int shmem_init_fs_context(struct fs_context *fc)
 	ctx->uid = current_fsuid();
 	ctx->gid = current_fsgid();
 
+	ctx->encoding = NULL;
+
 	fc->fs_private = ctx;
 	fc->ops = &shmem_fs_context_ops;
 	return 0;
-- 
2.46.0



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

* [PATCH 2/5] tmpfs: Add flag FS_CASEFOLD_FL support for tmpfs dirs
  2024-08-23 17:33 [PATCH 0/5] tmpfs: Add case-insesitive support for tmpfs André Almeida
  2024-08-23 17:33 ` [PATCH 1/5] tmpfs: Add casefold lookup support André Almeida
@ 2024-08-23 17:33 ` André Almeida
  2024-08-23 17:33 ` [PATCH 3/5] tmpfs: Create casefold mount options André Almeida
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: André Almeida @ 2024-08-23 17:33 UTC (permalink / raw)
  To: Hugh Dickins, Andrew Morton, Alexander Viro, Christian Brauner,
	Jan Kara
  Cc: linux-mm, linux-kernel, linux-fsdevel, kernel-dev, krisman,
	Daniel Rosenberg, smcv, André Almeida

Enable setting flag FS_CASEFOLD_FL for tmpfs directories, when tmpfs is
mounted with casefold support. A special check is need for this flag,
since it can't be set for non-empty directories.

Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
 include/linux/shmem_fs.h |  6 +++---
 mm/shmem.c               | 40 +++++++++++++++++++++++++++++++++-------
 2 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 1a1196b077a6..acec92564122 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -42,10 +42,10 @@ struct shmem_inode_info {
 	struct inode		vfs_inode;
 };
 
-#define SHMEM_FL_USER_VISIBLE		FS_FL_USER_VISIBLE
+#define SHMEM_FL_USER_VISIBLE		(FS_FL_USER_VISIBLE | FS_CASEFOLD_FL)
 #define SHMEM_FL_USER_MODIFIABLE \
-	(FS_IMMUTABLE_FL | FS_APPEND_FL | FS_NODUMP_FL | FS_NOATIME_FL)
-#define SHMEM_FL_INHERITED		(FS_NODUMP_FL | FS_NOATIME_FL)
+	(FS_IMMUTABLE_FL | FS_APPEND_FL | FS_NODUMP_FL | FS_NOATIME_FL | FS_CASEFOLD_FL)
+#define SHMEM_FL_INHERITED		(FS_NODUMP_FL | FS_NOATIME_FL | FS_CASEFOLD_FL)
 
 struct shmem_quota_limits {
 	qsize_t usrquota_bhardlimit; /* Default user quota block hard limit */
diff --git a/mm/shmem.c b/mm/shmem.c
index aa272c62f811..67b6ab580ca2 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2617,9 +2617,26 @@ static int shmem_initxattrs(struct inode *, const struct xattr *, void *);
  * chattr's fsflags are unrelated to extended attributes,
  * but tmpfs has chosen to enable them under the same config option.
  */
-static void shmem_set_inode_flags(struct inode *inode, unsigned int fsflags)
+static int shmem_set_inode_flags(struct inode *inode, unsigned int fsflags, struct dentry *dentry)
 {
-	unsigned int i_flags = 0;
+	unsigned int i_flags = 0, old = inode->i_flags;
+	struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
+
+	if (fsflags & FS_CASEFOLD_FL) {
+		if (!sbinfo->casefold)
+			return -EOPNOTSUPP;
+
+		if (!S_ISDIR(inode->i_mode))
+			return -ENOTDIR;
+
+		if (dentry && !simple_empty(dentry))
+			return -ENOTEMPTY;
+
+		i_flags |= S_CASEFOLD;
+	} else if (old & S_CASEFOLD) {
+		if (dentry && !simple_empty(dentry))
+			return -ENOTEMPTY;
+	}
 
 	if (fsflags & FS_NOATIME_FL)
 		i_flags |= S_NOATIME;
@@ -2630,10 +2647,12 @@ static void shmem_set_inode_flags(struct inode *inode, unsigned int fsflags)
 	/*
 	 * But FS_NODUMP_FL does not require any action in i_flags.
 	 */
-	inode_set_flags(inode, i_flags, S_NOATIME | S_APPEND | S_IMMUTABLE);
+	inode_set_flags(inode, i_flags, S_NOATIME | S_APPEND | S_IMMUTABLE | S_CASEFOLD);
+
+	return 0;
 }
 #else
-static void shmem_set_inode_flags(struct inode *inode, unsigned int fsflags)
+static void shmem_set_inode_flags(struct inode *inode, unsigned int fsflags, struct dentry *dentry)
 {
 }
 #define shmem_initxattrs NULL
@@ -2680,7 +2699,7 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap,
 	info->fsflags = (dir == NULL) ? 0 :
 		SHMEM_I(dir)->fsflags & SHMEM_FL_INHERITED;
 	if (info->fsflags)
-		shmem_set_inode_flags(inode, info->fsflags);
+		shmem_set_inode_flags(inode, info->fsflags, NULL);
 	INIT_LIST_HEAD(&info->shrinklist);
 	INIT_LIST_HEAD(&info->swaplist);
 	simple_xattrs_init(&info->xattrs);
@@ -3788,16 +3807,23 @@ static int shmem_fileattr_set(struct mnt_idmap *idmap,
 {
 	struct inode *inode = d_inode(dentry);
 	struct shmem_inode_info *info = SHMEM_I(inode);
+	int ret, flags;
 
 	if (fileattr_has_fsx(fa))
 		return -EOPNOTSUPP;
 	if (fa->flags & ~SHMEM_FL_USER_MODIFIABLE)
 		return -EOPNOTSUPP;
 
-	info->fsflags = (info->fsflags & ~SHMEM_FL_USER_MODIFIABLE) |
+	flags = (info->fsflags & ~SHMEM_FL_USER_MODIFIABLE) |
 		(fa->flags & SHMEM_FL_USER_MODIFIABLE);
 
-	shmem_set_inode_flags(inode, info->fsflags);
+	ret = shmem_set_inode_flags(inode, flags, dentry);
+
+	if (ret)
+		return ret;
+
+	info->fsflags = flags;
+
 	inode_set_ctime_current(inode);
 	inode_inc_iversion(inode);
 	return 0;
-- 
2.46.0



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

* [PATCH 3/5] tmpfs: Create casefold mount options
  2024-08-23 17:33 [PATCH 0/5] tmpfs: Add case-insesitive support for tmpfs André Almeida
  2024-08-23 17:33 ` [PATCH 1/5] tmpfs: Add casefold lookup support André Almeida
  2024-08-23 17:33 ` [PATCH 2/5] tmpfs: Add flag FS_CASEFOLD_FL support for tmpfs dirs André Almeida
@ 2024-08-23 17:33 ` André Almeida
  2024-08-29  9:25   ` Dan Carpenter
  2024-08-23 17:33 ` [PATCH 4/5] tmpfs: Expose filesystem features via sysfs André Almeida
  2024-08-23 17:33 ` [PATCH 5/5] docs: tmpfs: Add casefold options André Almeida
  4 siblings, 1 reply; 10+ messages in thread
From: André Almeida @ 2024-08-23 17:33 UTC (permalink / raw)
  To: Hugh Dickins, Andrew Morton, Alexander Viro, Christian Brauner,
	Jan Kara
  Cc: linux-mm, linux-kernel, linux-fsdevel, kernel-dev, krisman,
	Daniel Rosenberg, smcv, André Almeida

Most filesystems have their data stored in disk, so casefold option need
to be enabled when building a filesystem on a device (via mkfs).
However, as tmpfs is a RAM backed filesystem, there's no disk
information and thus no mkfs to store information about casefold.

For tmpfs, create casefold options for mounting. Userspace can then
enable casefold support for a mount point using:

$ mount -t tmpfs -o casefold=utf8-12.1.0 fs_name mount_dir/

Userspace must set what Unicode standard is aiming to. The available
options depends on what the kernel Unicode subsystem supports.

And for strict encoding:

$ mount -t tmpfs -o casefold=utf8-12.1.0,strict_encoding fs_name mount_dir/

Strict encoding means that tmpfs will refuse to create invalid UTF-8
sequences. When this option is not enabled, any invalid sequence will be
treated as an opaque byte sequence, ignoring the encoding thus not being
able to be looked up in a case-insensitive way.

Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
 mm/shmem.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/mm/shmem.c b/mm/shmem.c
index 67b6ab580ca2..5c77b4e73204 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4102,6 +4102,8 @@ enum shmem_param {
 	Opt_usrquota_inode_hardlimit,
 	Opt_grpquota_block_hardlimit,
 	Opt_grpquota_inode_hardlimit,
+	Opt_casefold,
+	Opt_strict_encoding,
 };
 
 static const struct constant_table shmem_param_enums_huge[] = {
@@ -4133,9 +4135,67 @@ const struct fs_parameter_spec shmem_fs_parameters[] = {
 	fsparam_string("grpquota_block_hardlimit", Opt_grpquota_block_hardlimit),
 	fsparam_string("grpquota_inode_hardlimit", Opt_grpquota_inode_hardlimit),
 #endif
+	fsparam_string("casefold",	Opt_casefold),
+	fsparam_flag  ("strict_encoding", Opt_strict_encoding),
 	{}
 };
 
+#if IS_ENABLED(CONFIG_UNICODE)
+static int utf8_parse_version(const char *version, unsigned int *maj,
+			      unsigned int *min, unsigned int *rev)
+{
+	substring_t args[3];
+	char version_string[12];
+	static const struct match_token token[] = {
+		{1, "%d.%d.%d"},
+		{0, NULL}
+	};
+
+	strscpy(version_string, version, sizeof(version_string));
+
+	if (match_token(version_string, token, args) != 1)
+		return -EINVAL;
+
+	if (match_int(&args[0], maj) || match_int(&args[1], min) ||
+	    match_int(&args[2], rev))
+		return -EINVAL;
+
+	return 0;
+}
+
+static int shmem_parse_opt_casefold(struct fs_context *fc, struct fs_parameter *param)
+{
+	struct shmem_options *ctx = fc->fs_private;
+	unsigned int maj, min, rev, version_number;
+	char version[10];
+	int ret;
+	struct unicode_map *encoding;
+
+	if (strncmp(param->string, "utf8-", 5))
+		return invalfc(fc, "Only utf8 encondings are supported");
+	ret = strscpy(version, param->string + 5, sizeof(version));
+	if (ret < 0)
+		return invalfc(fc, "Invalid enconding argument: %s",
+			       param->string);
+
+	utf8_parse_version(version, &maj, &min, &rev);
+	version_number = UNICODE_AGE(maj, min, rev);
+	encoding = utf8_load(version_number);
+	if (IS_ERR(encoding))
+		return invalfc(fc, "Invalid utf8 version: %s", version);
+	pr_info("tmpfs: Using encoding provided by mount options: %s\n",
+		param->string);
+	ctx->encoding = encoding;
+
+	return 0;
+}
+#else
+static int shmem_parse_opt_casefold(struct fs_context *fc, struct fs_parameter *param)
+{
+	return invalfc(fc, "tmpfs: No kernel support for casefold filesystems\n");
+}
+#endif
+
 static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
 {
 	struct shmem_options *ctx = fc->fs_private;
@@ -4294,6 +4354,11 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
 				       "Group quota inode hardlimit too large.");
 		ctx->qlimits.grpquota_ihardlimit = size;
 		break;
+	case Opt_casefold:
+		return shmem_parse_opt_casefold(fc, param);
+	case Opt_strict_encoding:
+		ctx->strict_encoding = true;
+		break;
 	}
 	return 0;
 
-- 
2.46.0



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

* [PATCH 4/5] tmpfs: Expose filesystem features via sysfs
  2024-08-23 17:33 [PATCH 0/5] tmpfs: Add case-insesitive support for tmpfs André Almeida
                   ` (2 preceding siblings ...)
  2024-08-23 17:33 ` [PATCH 3/5] tmpfs: Create casefold mount options André Almeida
@ 2024-08-23 17:33 ` André Almeida
  2024-08-26 22:58   ` kernel test robot
  2024-08-23 17:33 ` [PATCH 5/5] docs: tmpfs: Add casefold options André Almeida
  4 siblings, 1 reply; 10+ messages in thread
From: André Almeida @ 2024-08-23 17:33 UTC (permalink / raw)
  To: Hugh Dickins, Andrew Morton, Alexander Viro, Christian Brauner,
	Jan Kara
  Cc: linux-mm, linux-kernel, linux-fsdevel, kernel-dev, krisman,
	Daniel Rosenberg, smcv, André Almeida

Expose filesystem features through sysfs, so userspace can query if
tmpfs support casefold.

This follows the same setup as defined by ext4 and f2fs to expose
casefold support to userspace.

Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
 mm/shmem.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/mm/shmem.c b/mm/shmem.c
index 5c77b4e73204..f6e19b88d647 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -5384,3 +5384,40 @@ struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
 	return page;
 }
 EXPORT_SYMBOL_GPL(shmem_read_mapping_page_gfp);
+
+#if defined(CONFIG_SYSFS) && defined(CONFIG_TMPFS)
+#if IS_ENABLED(CONFIG_UNICODE)
+DEVICE_STRING_ATTR_RO(casefold, 0444, "supported");
+#endif
+
+static struct attribute *tmpfs_attributes[] = {
+#if IS_ENABLED(CONFIG_UNICODE)
+	&dev_attr_casefold.attr.attr,
+#endif
+	NULL
+};
+
+static const struct attribute_group tmpfs_attribute_group = {
+	.attrs = tmpfs_attributes,
+	.name = "features"
+};
+
+static struct kobject *tmpfs_kobj;
+
+static int __init tmpfs_sysfs_init(void)
+{
+	int ret;
+
+	tmpfs_kobj = kobject_create_and_add("tmpfs", fs_kobj);
+	if (!tmpfs_kobj)
+		return -ENOMEM;
+
+	ret = sysfs_create_group(tmpfs_kobj, &tmpfs_attribute_group);
+	if (ret)
+		kobject_put(tmpfs_kobj);
+
+	return ret;
+}
+
+fs_initcall(tmpfs_sysfs_init);
+#endif /* CONFIG_SYSFS && CONFIG_TMPFS */
-- 
2.46.0



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

* [PATCH 5/5] docs: tmpfs: Add casefold options
  2024-08-23 17:33 [PATCH 0/5] tmpfs: Add case-insesitive support for tmpfs André Almeida
                   ` (3 preceding siblings ...)
  2024-08-23 17:33 ` [PATCH 4/5] tmpfs: Expose filesystem features via sysfs André Almeida
@ 2024-08-23 17:33 ` André Almeida
  4 siblings, 0 replies; 10+ messages in thread
From: André Almeida @ 2024-08-23 17:33 UTC (permalink / raw)
  To: Hugh Dickins, Andrew Morton, Alexander Viro, Christian Brauner,
	Jan Kara
  Cc: linux-mm, linux-kernel, linux-fsdevel, kernel-dev, krisman,
	Daniel Rosenberg, smcv, André Almeida

Document mounting options for casefold support in tmpfs.

Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
 Documentation/filesystems/tmpfs.rst | 37 +++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/Documentation/filesystems/tmpfs.rst b/Documentation/filesystems/tmpfs.rst
index 56a26c843dbe..ce24fb16979a 100644
--- a/Documentation/filesystems/tmpfs.rst
+++ b/Documentation/filesystems/tmpfs.rst
@@ -241,6 +241,41 @@ So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs'
 will give you tmpfs instance on /mytmpfs which can allocate 10GB
 RAM/SWAP in 10240 inodes and it is only accessible by root.
 
+tmpfs has the following mounting options for case-insesitive lookups support:
+
+================= ==============================================================
+casefold          Enable casefold support at this mount point using the given
+                  argument as the encoding standard. Currently only utf8
+                  encodings are supported.
+strict_encoding   Enable strict encoding at this mount point (disabled by
+                  default). This means that invalid sequences will be rejected
+                  by the file system.
+================= ==============================================================
+
+Note that this option doesn't enable casefold by default; one needs to set
+casefold flag per directory, setting the +F attribute in an empty directory. New
+directories within a casefolded one will inherit the flag.
+
+Example::
+
+    $ mount -t tmpfs -o casefold=utf8-12.1.0,cf_strict fs_name /mytmpfs
+    $ cd /mytmpfs # case-sensitive by default
+    $ touch a; touch A
+    $ ls
+    A  a
+    $ mkdir B
+    $ cd b
+    cd: The directory 'b' does not exist
+    $ mkdir casefold_dir
+    $ chattr +F casefold_dir/ # marking it as case-insensitive
+    $ cd
+    $ touch dir/a; touch dir/A
+    $ ls dir
+    a
+    $ mkdir B
+    $ cd b
+    $ pwd
+    /home/user/mytmpfs/casefold_dir/B
 
 :Author:
    Christoph Rohland <cr@sap.com>, 1.12.01
@@ -250,3 +285,5 @@ RAM/SWAP in 10240 inodes and it is only accessible by root.
    KOSAKI Motohiro, 16 Mar 2010
 :Updated:
    Chris Down, 13 July 2020
+:Updated:
+   André Almeida, 23 Aug 2024
-- 
2.46.0



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

* Re: [PATCH 1/5] tmpfs: Add casefold lookup support
  2024-08-23 17:33 ` [PATCH 1/5] tmpfs: Add casefold lookup support André Almeida
@ 2024-08-26 19:16   ` Gabriel Krisman Bertazi
  2024-08-26 23:40   ` kernel test robot
  1 sibling, 0 replies; 10+ messages in thread
From: Gabriel Krisman Bertazi @ 2024-08-26 19:16 UTC (permalink / raw)
  To: André Almeida
  Cc: Hugh Dickins, Andrew Morton, Alexander Viro, Christian Brauner,
	Jan Kara, linux-mm, linux-kernel, linux-fsdevel, kernel-dev,
	krisman, Daniel Rosenberg, smcv

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

> Enable casefold lookup in tmpfs, based on the enconding defined by
> userspace. That means that instead of comparing byte per byte a file
> name, it compares to a case-insensitive equivalent of the Unicode
> string.

Hey,
>
> * dcache handling
>
> There's a special need when dealing with case-insensitive dentries.
> First of all, we currently invalidated every negative casefold dentries.
> That happens because currently VFS code has no proper support to deal
> with that, giving that it could incorrectly reuse a previous filename
> for a new file that has a casefold match. For instance, this could
> happen:
>
> $ mkdir DIR
> $ rm -r DIR
> $ mkdir dir
> $ ls
> DIR/

Right. Hopefully we can lift the limitation once we get the negative
dentry support for casefolded directories merged.

> And would be perceived as inconsistency from userspace point of view,
> because even that we match files in a case-insensitive manner, we still
> honor whatever is the initial filename.
>
> Along with that, tmpfs stores only the first equivalent name dentry used
> in the dcache, preventing duplications of dentries in the dcache. The
> d_compare() version for casefold files stores a normalized string, and
> before every lookup, the filename is normalized as well, achieving a
> casefolded lookup.

This is a bit misleading, because d_compare doesn't store
anything. d_compare does a case-insensitive comparison of the
filename-under-lookup with the dentry name, but it doesn't store
filename-under-lookup.

>  2 files changed, 63 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
> index 1d06b1e5408a..1a1196b077a6 100644
> --- a/include/linux/shmem_fs.h
> +++ b/include/linux/shmem_fs.h
> @@ -73,6 +73,7 @@ struct shmem_sb_info {
>  	struct list_head shrinklist;  /* List of shinkable inodes */
>  	unsigned long shrinklist_len; /* Length of shrinklist */
>  	struct shmem_quota_limits qlimits; /* Default quota limits */
> +	bool casefold;

This is redundant. you can just check sb->s_encoding != NULL.
>  };
>  
>  static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 5a77acf6ac6a..aa272c62f811 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -40,6 +40,8 @@
>  #include <linux/fs_parser.h>
>  #include <linux/swapfile.h>
>  #include <linux/iversion.h>
> +#include <linux/unicode.h>
> +#include <linux/parser.h>
>  #include "swap.h"
>  
>  static struct vfsmount *shm_mnt __ro_after_init;
> @@ -123,6 +125,8 @@ struct shmem_options {
>  	bool noswap;
>  	unsigned short quota_types;
>  	struct shmem_quota_limits qlimits;
> +	struct unicode_map *encoding;
> +	bool strict_encoding;
>  #define SHMEM_SEEN_BLOCKS 1
>  #define SHMEM_SEEN_INODES 2
>  #define SHMEM_SEEN_HUGE 4
> @@ -3427,6 +3431,12 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir,
>  	if (IS_ERR(inode))
>  		return PTR_ERR(inode);
>  
> +#if IS_ENABLED(CONFIG_UNICODE)
> +	if (sb_has_strict_encoding(dir->i_sb) && IS_CASEFOLDED(dir) &&
> +	    dir->i_sb->s_encoding && utf8_validate(dir->i_sb->s_encoding, &dentry->d_name))
> +		return -EINVAL;
> +#endif

Can you made this a helper that other filesystems can use?  Also,
sorting it to check IS_CASEFOLDED(dir) first would be a good idea.

> +
>  	error = simple_acl_create(dir, inode);
>  	if (error)
>  		goto out_iput;
> @@ -3435,6 +3445,9 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir,
>  	if (error && error != -EOPNOTSUPP)
>  		goto out_iput;
>  
> +	if (IS_CASEFOLDED(dir))
> +		d_add(dentry, NULL);
> +

I get why you do this here and elsewhere: Since we disable negative
dentries in case-insensitive directories, you have an unhashed dentry
here.  We can get away with it in ext4/f2fs because the next lookup will
find the file on disk and create the dentry, but in shmem we need to
hash it.

But it is not the right way to do it. you are effectively creating a
negative dentry to turn it positive right below. One problem with that
is that if simple_offset_add() fails, you left an illegal negative
dentry in a case-insensitive directory. Another, is that a parallel
lookup will be able to find the negative dentry temporarily.  fsnotify
will also behave weirdly.

What I think you should do is call d_add once with the proper inode and
never call d_instantiate for it.

> +	/*
> +	 * For now, VFS can't deal with case-insensitive negative dentries, so
> +	 * we destroy them
> +	 */
> +	if (IS_CASEFOLDED(dir))
> +		d_invalidate(dentry);
> +
>  	return 0;
>  }

s/destroy/invalidate/


> @@ -4471,6 +4497,11 @@ static void shmem_put_super(struct super_block *sb)
>  {
>  	struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
>  
> +#if IS_ENABLED(CONFIG_UNICODE)
> +	if (sbinfo->casefold)
> +		utf8_unload(sb->s_encoding);
> +#endif

if (sb->s_encoding)
  utf8_unload(sb->s_encoding);

> +#if IS_ENABLED(CONFIG_UNICODE)
> +	if (ctx->encoding) {
> +		sb->s_encoding = ctx->encoding;
> +		generic_set_sb_d_ops(sb);
> +		if (ctx->strict_encoding)
> +			sb->s_encoding_flags = SB_ENC_STRICT_MODE_FL;
> +		sbinfo->casefold = true;
> +	}
> +#endif
> +
>  #else
>  	sb->s_flags |= SB_NOUSER;
>  #endif
> @@ -4704,11 +4746,28 @@ static const struct inode_operations shmem_inode_operations = {
>  #endif
>  };
>  
> +static struct dentry *shmem_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
> +{
> +	if (dentry->d_name.len > NAME_MAX)
> +		return ERR_PTR(-ENAMETOOLONG);
> +
> +	/*
> +	 * For now, VFS can't deal with case-insensitive negative dentries, so
> +	 * we prevent them from being created
> +	 */
> +	if (IS_CASEFOLDED(dir))
> +		return NULL;
> +
> +	d_add(dentry, NULL);
> +
> +	return NULL;
> +}
> +
>  static const struct inode_operations shmem_dir_inode_operations = {
>  #ifdef CONFIG_TMPFS
>  	.getattr	= shmem_getattr,
>  	.create		= shmem_create,
> -	.lookup		= simple_lookup,
> +	.lookup		= shmem_lookup,
>  	.link		= shmem_link,
>  	.unlink		= shmem_unlink,
>  	.symlink	= shmem_symlink,
> @@ -4791,6 +4850,8 @@ int shmem_init_fs_context(struct fs_context *fc)
>  	ctx->uid = current_fsuid();
>  	ctx->gid = current_fsgid();
>  
> +	ctx->encoding = NULL;
> +

I find the organization of this patchset a bit weird because the other
part of the init_fs_context is only done in patch 3.  Perhaps 1 and 3
should be merged together to make review easier.


-- 
Gabriel Krisman Bertazi


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

* Re: [PATCH 4/5] tmpfs: Expose filesystem features via sysfs
  2024-08-23 17:33 ` [PATCH 4/5] tmpfs: Expose filesystem features via sysfs André Almeida
@ 2024-08-26 22:58   ` kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2024-08-26 22:58 UTC (permalink / raw)
  To: André Almeida, Hugh Dickins, Andrew Morton, Alexander Viro,
	Christian Brauner, Jan Kara
  Cc: oe-kbuild-all, Linux Memory Management List, linux-kernel,
	linux-fsdevel, kernel-dev, krisman, Daniel Rosenberg, smcv,
	André Almeida

Hi André,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.11-rc5 next-20240826]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andr-Almeida/tmpfs-Add-casefold-lookup-support/20240826-135457
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20240823173332.281211-5-andrealmeid%40igalia.com
patch subject: [PATCH 4/5] tmpfs: Expose filesystem features via sysfs
config: i386-randconfig-063-20240827 (https://download.01.org/0day-ci/archive/20240827/202408270618.4ue8oNhS-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240827/202408270618.4ue8oNhS-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408270618.4ue8oNhS-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> mm/shmem.c:5515:1: sparse: sparse: symbol 'dev_attr_casefold' was not declared. Should it be static?

vim +/dev_attr_casefold +5515 mm/shmem.c

  5512	
  5513	#if defined(CONFIG_SYSFS) && defined(CONFIG_TMPFS)
  5514	#if IS_ENABLED(CONFIG_UNICODE)
> 5515	DEVICE_STRING_ATTR_RO(casefold, 0444, "supported");
  5516	#endif
  5517	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

* Re: [PATCH 1/5] tmpfs: Add casefold lookup support
  2024-08-23 17:33 ` [PATCH 1/5] tmpfs: Add casefold lookup support André Almeida
  2024-08-26 19:16   ` Gabriel Krisman Bertazi
@ 2024-08-26 23:40   ` kernel test robot
  1 sibling, 0 replies; 10+ messages in thread
From: kernel test robot @ 2024-08-26 23:40 UTC (permalink / raw)
  To: André Almeida, Hugh Dickins, Andrew Morton, Alexander Viro,
	Christian Brauner, Jan Kara
  Cc: oe-kbuild-all, Linux Memory Management List, linux-kernel,
	linux-fsdevel, kernel-dev, krisman, Daniel Rosenberg, smcv,
	André Almeida

Hi André,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.11-rc5 next-20240826]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andr-Almeida/tmpfs-Add-casefold-lookup-support/20240826-135457
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20240823173332.281211-2-andrealmeid%40igalia.com
patch subject: [PATCH 1/5] tmpfs: Add casefold lookup support
config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20240827/202408270609.Nj6iM21E-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240827/202408270609.Nj6iM21E-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408270609.Nj6iM21E-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/shmem.c:4874:23: warning: 'shmem_lookup' defined but not used [-Wunused-function]
    4874 | static struct dentry *shmem_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
         |                       ^~~~~~~~~~~~


vim +/shmem_lookup +4874 mm/shmem.c

  4873	
> 4874	static struct dentry *shmem_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
  4875	{
  4876		if (dentry->d_name.len > NAME_MAX)
  4877			return ERR_PTR(-ENAMETOOLONG);
  4878	
  4879		/*
  4880		 * For now, VFS can't deal with case-insensitive negative dentries, so
  4881		 * we prevent them from being created
  4882		 */
  4883		if (IS_CASEFOLDED(dir))
  4884			return NULL;
  4885	
  4886		d_add(dentry, NULL);
  4887	
  4888		return NULL;
  4889	}
  4890	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

* Re: [PATCH 3/5] tmpfs: Create casefold mount options
  2024-08-23 17:33 ` [PATCH 3/5] tmpfs: Create casefold mount options André Almeida
@ 2024-08-29  9:25   ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2024-08-29  9:25 UTC (permalink / raw)
  To: oe-kbuild, André Almeida, Hugh Dickins, Andrew Morton,
	Alexander Viro, Christian Brauner, Jan Kara
  Cc: lkp, oe-kbuild-all, Linux Memory Management List, linux-kernel,
	linux-fsdevel, kernel-dev, krisman, Daniel Rosenberg, smcv,
	André Almeida

Hi André,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andr-Almeida/tmpfs-Add-casefold-lookup-support/20240826-135457
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20240823173332.281211-4-andrealmeid%40igalia.com
patch subject: [PATCH 3/5] tmpfs: Create casefold mount options
config: x86_64-randconfig-161-20240827 (https://download.01.org/0day-ci/archive/20240829/202408290349.lp2Eq74b-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202408290349.lp2Eq74b-lkp@intel.com/

smatch warnings:
mm/shmem.c:4307 shmem_parse_opt_casefold() error: uninitialized symbol 'maj'.
mm/shmem.c:4307 shmem_parse_opt_casefold() error: uninitialized symbol 'min'.
mm/shmem.c:4307 shmem_parse_opt_casefold() error: uninitialized symbol 'rev'.

vim +/maj +4307 mm/shmem.c

a024e87c2944676 André Almeida 2024-08-23  4291  static int shmem_parse_opt_casefold(struct fs_context *fc, struct fs_parameter *param)
a024e87c2944676 André Almeida 2024-08-23  4292  {
a024e87c2944676 André Almeida 2024-08-23  4293  	struct shmem_options *ctx = fc->fs_private;
a024e87c2944676 André Almeida 2024-08-23  4294  	unsigned int maj, min, rev, version_number;
a024e87c2944676 André Almeida 2024-08-23  4295  	char version[10];
a024e87c2944676 André Almeida 2024-08-23  4296  	int ret;
a024e87c2944676 André Almeida 2024-08-23  4297  	struct unicode_map *encoding;
a024e87c2944676 André Almeida 2024-08-23  4298  
a024e87c2944676 André Almeida 2024-08-23  4299  	if (strncmp(param->string, "utf8-", 5))
a024e87c2944676 André Almeida 2024-08-23  4300  		return invalfc(fc, "Only utf8 encondings are supported");
a024e87c2944676 André Almeida 2024-08-23  4301  	ret = strscpy(version, param->string + 5, sizeof(version));
a024e87c2944676 André Almeida 2024-08-23  4302  	if (ret < 0)
a024e87c2944676 André Almeida 2024-08-23  4303  		return invalfc(fc, "Invalid enconding argument: %s",
a024e87c2944676 André Almeida 2024-08-23  4304  			       param->string);
a024e87c2944676 André Almeida 2024-08-23  4305  
a024e87c2944676 André Almeida 2024-08-23  4306  	utf8_parse_version(version, &maj, &min, &rev);

No error checking

a024e87c2944676 André Almeida 2024-08-23 @4307  	version_number = UNICODE_AGE(maj, min, rev);
                                                                                     ^^^^^^^^^^^^^

a024e87c2944676 André Almeida 2024-08-23  4308  	encoding = utf8_load(version_number);
a024e87c2944676 André Almeida 2024-08-23  4309  	if (IS_ERR(encoding))
a024e87c2944676 André Almeida 2024-08-23  4310  		return invalfc(fc, "Invalid utf8 version: %s", version);
a024e87c2944676 André Almeida 2024-08-23  4311  	pr_info("tmpfs: Using encoding provided by mount options: %s\n",
a024e87c2944676 André Almeida 2024-08-23  4312  		param->string);
a024e87c2944676 André Almeida 2024-08-23  4313  	ctx->encoding = encoding;
a024e87c2944676 André Almeida 2024-08-23  4314  
a024e87c2944676 André Almeida 2024-08-23  4315  	return 0;
a024e87c2944676 André Almeida 2024-08-23  4316  }
a024e87c2944676 André Almeida 2024-08-23  4317  #else
a024e87c2944676 André Almeida 2024-08-23  4318  static int shmem_parse_opt_casefold(struct fs_context *fc, struct fs_parameter *param)
a024e87c2944676 André Almeida 2024-08-23  4319  {
a024e87c2944676 André Almeida 2024-08-23  4320  	return invalfc(fc, "tmpfs: No kernel support for casefold filesystems\n");
a024e87c2944676 André Almeida 2024-08-23  4321  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



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

end of thread, other threads:[~2024-08-29  9:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 17:33 [PATCH 0/5] tmpfs: Add case-insesitive support for tmpfs André Almeida
2024-08-23 17:33 ` [PATCH 1/5] tmpfs: Add casefold lookup support André Almeida
2024-08-26 19:16   ` Gabriel Krisman Bertazi
2024-08-26 23:40   ` kernel test robot
2024-08-23 17:33 ` [PATCH 2/5] tmpfs: Add flag FS_CASEFOLD_FL support for tmpfs dirs André Almeida
2024-08-23 17:33 ` [PATCH 3/5] tmpfs: Create casefold mount options André Almeida
2024-08-29  9:25   ` Dan Carpenter
2024-08-23 17:33 ` [PATCH 4/5] tmpfs: Expose filesystem features via sysfs André Almeida
2024-08-26 22:58   ` kernel test robot
2024-08-23 17:33 ` [PATCH 5/5] docs: tmpfs: Add casefold options André Almeida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).