[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260116144616.2098618-4-cel@kernel.org>
Date: Fri, 16 Jan 2026 09:46:02 -0500
From: Chuck Lever <cel@...nel.org>
To: Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
Jan Kara <jack@...e.cz>
Cc: <linux-fsdevel@...r.kernel.org>,
linux-ext4@...r.kernel.org,
linux-xfs@...r.kernel.org,
linux-cifs@...r.kernel.org,
<linux-nfs@...r.kernel.org>,
linux-f2fs-devel@...ts.sourceforge.net,
hirofumi@...l.parknet.co.jp,
linkinjeon@...nel.org,
sj1557.seo@...sung.com,
yuezhang.mo@...y.com,
almaz.alexandrovich@...agon-software.com,
slava@...eyko.com,
glaubitz@...sik.fu-berlin.de,
frank.li@...o.com,
tytso@....edu,
adilger.kernel@...ger.ca,
cem@...nel.org,
sfrench@...ba.org,
pc@...guebit.org,
ronniesahlberg@...il.com,
sprasad@...rosoft.com,
trondmy@...nel.org,
anna@...nel.org,
jaegeuk@...nel.org,
chao@...nel.org,
hansg@...nel.org,
senozhatsky@...omium.org,
Chuck Lever <chuck.lever@...cle.com>
Subject: [PATCH v5 03/16] exfat: Implement fileattr_get for case sensitivity
From: Chuck Lever <chuck.lever@...cle.com>
Report exFAT's case sensitivity behavior via the file_kattr boolean
fields. exFAT is always case-insensitive (using an upcase table for
comparison) and always preserves case at rest.
Acked-by: Namjae Jeon <linkinjeon@...nel.org>
Signed-off-by: Chuck Lever <chuck.lever@...cle.com>
---
fs/exfat/exfat_fs.h | 2 ++
fs/exfat/file.c | 16 ++++++++++++++--
fs/exfat/namei.c | 1 +
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h
index 176fef62574c..11c782a28843 100644
--- a/fs/exfat/exfat_fs.h
+++ b/fs/exfat/exfat_fs.h
@@ -468,6 +468,8 @@ int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
int exfat_getattr(struct mnt_idmap *idmap, const struct path *path,
struct kstat *stat, unsigned int request_mask,
unsigned int query_flags);
+struct file_kattr;
+int exfat_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
int exfat_file_fsync(struct file *file, loff_t start, loff_t end, int datasync);
long exfat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
long exfat_compat_ioctl(struct file *filp, unsigned int cmd,
diff --git a/fs/exfat/file.c b/fs/exfat/file.c
index 536c8078f0c1..79938072e1cb 100644
--- a/fs/exfat/file.c
+++ b/fs/exfat/file.c
@@ -12,6 +12,7 @@
#include <linux/security.h>
#include <linux/msdos_fs.h>
#include <linux/writeback.h>
+#include <linux/fileattr.h>
#include "exfat_raw.h"
#include "exfat_fs.h"
@@ -281,6 +282,16 @@ int exfat_getattr(struct mnt_idmap *idmap, const struct path *path,
return 0;
}
+int exfat_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
+{
+ /*
+ * exFAT is always case-insensitive (using upcase table).
+ * Case is preserved at rest (the default).
+ */
+ fa->case_insensitive = true;
+ return 0;
+}
+
int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
struct iattr *attr)
{
@@ -775,6 +786,7 @@ const struct file_operations exfat_file_operations = {
};
const struct inode_operations exfat_file_inode_operations = {
- .setattr = exfat_setattr,
- .getattr = exfat_getattr,
+ .setattr = exfat_setattr,
+ .getattr = exfat_getattr,
+ .fileattr_get = exfat_fileattr_get,
};
diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
index dfe957493d49..a3a854ddc83a 100644
--- a/fs/exfat/namei.c
+++ b/fs/exfat/namei.c
@@ -1323,4 +1323,5 @@ const struct inode_operations exfat_dir_inode_operations = {
.rename = exfat_rename,
.setattr = exfat_setattr,
.getattr = exfat_getattr,
+ .fileattr_get = exfat_fileattr_get,
};
--
2.52.0
Powered by blists - more mailing lists