From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25907299929; Sat, 2 May 2026 14:21:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777731696; cv=none; b=kHnl2JpIgZ6nCD/cXkffA9jYjgr1XUG7yS9wHFvZEQA7YkqIOMXlqQgIdI8M1FpUWxx0C9P6pVF5m73fABz2S7asn+dnUh08c7bHMUrr4EVygUSUEVw5I0itPckYKBVZkfmNolr71ZwmiXkYIm6IMpIeYBy4FCz9J21QXlJX/T8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777731696; c=relaxed/simple; bh=dJoqE7xg5dnDwM8zJtU22ff7SFmezUgNm6OnXSD6EvA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=H6HmasQSAQjrQMYUKfcgz4X79UB3LxalB+zmJH2STVyUzFphqT6X9fdbnA9PKeP8+lSYAFCKgPRhhzFGT90HAHfMQ4QfAIOSh5GJI5C6QvUquVj+n5CIJ9xFtTxtA6YH047FPFyO2D7nK/CVtuposIsEZSuqkpUrB4KFcKEHyk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WyjdR5lb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WyjdR5lb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4603DC19425; Sat, 2 May 2026 14:21:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777731695; bh=dJoqE7xg5dnDwM8zJtU22ff7SFmezUgNm6OnXSD6EvA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WyjdR5lb9D8b02akU1M7YOd6zUj1wjvRXJgEjmvNVDUmBHc5yY+CW0OkboOq3Nvci sY94N3aXFL6LyVhp2CwWVWw68XO1Vn4lD02PO0mTTlQL7mA8itScfQOV3BCPFh+jd9 Qp/dGl6WJ2Rsu4zblVDXhwz3ykFBeUJLQrkJj3Y4qN3geD8I92L8pI1dZZAA/i4M+r pw52Z5gNoGzQpLUoLfGDUYSmNupcZznx2u1SdJIuf1pz+T/YSJT9t2wqfeNmJQN+Rm PtGtVzJeCtoiA/YauyAp26dKMBu/Rfw+ZgLS83t6i7nMFR/4XDGhE7FLaEvxjnB8dF uirmNFIWKfE5A== From: Chuck Lever Date: Sat, 02 May 2026 10:20:49 -0400 Subject: [PATCH v13 04/15] exfat: Implement fileattr_get for case sensitivity Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260502-case-sensitivity-v13-4-aa853140311f@oracle.com> References: <20260502-case-sensitivity-v13-0-aa853140311f@oracle.com> In-Reply-To: <20260502-case-sensitivity-v13-0-aa853140311f@oracle.com> To: Al Viro , Christian Brauner , Jan Kara Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-api@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, hirofumi@mail.parknet.co.jp, linkinjeon@kernel.org, sj1557.seo@samsung.com, yuezhang.mo@sony.com, almaz.alexandrovich@paragon-software.com, slava@dubeyko.com, glaubitz@physik.fu-berlin.de, frank.li@vivo.com, tytso@mit.edu, adilger.kernel@dilger.ca, cem@kernel.org, sfrench@samba.org, pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com, trondmy@kernel.org, anna@kernel.org, jaegeuk@kernel.org, chao@kernel.org, hansg@kernel.org, senozhatsky@chromium.org, Chuck Lever , Roland Mainz X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2811; i=chuck.lever@oracle.com; h=from:subject:message-id; bh=w3256AVp6CHVnoJXu0KmBiEb3facwwFeSKlsCd+l9ow=; b=owEBbQKS/ZANAwAKATNqszNvZn+XAcsmYgBp9ghQwVydV/I6FUYHtpFOKOuxrA5/yrQacOPAA XepyKUb+vyJAjMEAAEKAB0WIQQosuWwEobfJDzyPv4zarMzb2Z/lwUCafYIUAAKCRAzarMzb2Z/ l2xrD/461UqAsREpMVKet2RbTKHxJsI0yc9d+c1UnTQLFF9/UHlxCoFemStk2bG27wgEU8YkPi5 pp0TXqGq04h5xhIr/0QLrl65NW3rVVA1RSQO6HEO9jBiNpd1Ze4M81TANAnZwgoCXtyERVO8jNu uoPAkMsLP8TXZSgkqjWfOi1EOBKNaYPndA2/ll1sIQIrzfhw9tejp5+CAk5qy55NaWDVo7Bxhp7 5+6uTWeGLhIgTtZO+Qfog6FcQYq9SoqYed5zp+U/FTgKnLsDBJO8Q3Ra8CWwwp9+COslescvHjn fiF0YNAAOH/c3Ammw2bKNNdyQgLRyTERvoIyauudqAzZWTM4NQ0kVFlPPHhiMZ54qb0LULlmFhR CWPFn4vAR8kXe/65s7Wh6IAWHoJwQJpnyHmw5PQ1y3R+7p6bFPBRzIE0Z/Y944+GePV51PQWmbn oG95qaWEOrww393FMcSwV8Fot8uYlqsVZMIR6qqXSGCt1QGKuFK4GXeXGixAubZJpfdtFHvT/RS NGovTmsPtzmSEWhmIZI2PLYfcs+Az33gQdBVmoMwuBzqptsbELyBb7W7NszDFcIgEkyeeUyN/wK 5M+eivWKwhV7l876sdXHwErHowguQuiRaLSDrl1BOx8LhLVA/n0Fbm8IV7Fbk+FBhw8Vl0+LqD3 IcrnyunSfNdjGrA== X-Developer-Key: i=chuck.lever@oracle.com; a=openpgp; fpr=28B2E5B01286DF243CF23EFE336AB3336F667F97 From: Chuck Lever Report exFAT's case sensitivity behavior via the FS_XFLAG_CASEFOLD flag. exFAT compares names through the volume's upcase table; in practice that table folds case, and case is preserved at rest. Acked-by: Namjae Jeon Reviewed-by: Roland Mainz Signed-off-by: Chuck Lever --- fs/exfat/exfat_fs.h | 2 ++ fs/exfat/file.c | 18 ++++++++++++++++-- fs/exfat/namei.c | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index 89ef5368277f..aff4dcd4e75a 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -496,6 +496,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 354bdcfe4abc..91e5511945d1 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "exfat_raw.h" #include "exfat_fs.h" @@ -323,6 +324,18 @@ 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 compares filenames through an upcase table, so lookup + * is always case-insensitive. Long names are stored in UTF-16 + * with case intact; CASENONPRESERVING stays clear. + */ + fa->fsx_xflags |= FS_XFLAG_CASEFOLD; + fa->flags |= FS_CASEFOLD_FL; + return 0; +} + int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr) { @@ -817,6 +830,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 2c5636634b4a..94002e43db08 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -1311,4 +1311,5 @@ const struct inode_operations exfat_dir_inode_operations = { .rename = exfat_rename, .setattr = exfat_setattr, .getattr = exfat_getattr, + .fileattr_get = exfat_fileattr_get, }; -- 2.53.0