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 11F3A43E9F0; Tue, 20 Jan 2026 14:24:52 +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=1768919093; cv=none; b=vGP8zgbXv69KpHCWNUSTaGZMycLHcpnP2dpSlbMDYHs9GzzZJpO7puD+HESTuXnnpYniQq32XiRELQizOWntvwIBliXpdwhZildAseNm0DKy14w0O1ysiW+jKKFlLzdx46mgvWedIfdLYVLPBsYPVCyc+RilsDj6Y8ECeijxQIM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919093; c=relaxed/simple; bh=cdGgjhkthDimE+ptoeLNf3meapvWMt+C25jv3VF6XKw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Id9OAd/xGRQtUDswQbU+JYbOj32tsdzrROULhvdpCVeIshZoivfMtG6Q7hlOqfXWl4AxfbdOLlkMJTL2ohfnek48oPFq1siifkXW1IG6GGWlM+Bsv7m8F+0Mouy/oG0sXrysxY6QG0ljMdRmKIVqnsWqIAOTlyJAr7eJabFRlNQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jIPeIBgO; 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="jIPeIBgO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90DAEC19423; Tue, 20 Jan 2026 14:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768919092; bh=cdGgjhkthDimE+ptoeLNf3meapvWMt+C25jv3VF6XKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jIPeIBgOeFf6O7e6qIIS/fpl54U7X9mFsC+kIOit92HJ316cCi+QXKZOczXO06N5P XcNjfZPag6DBR+Tq9dzqfLEkiL3C0x8gYIdwd6+pF+chLy7hseLVFrhpNj2eOiWC+e vd15II+hclnkQjn+Smb+UDDZ+YhS2qeI+A2hHOMP7L0HfVbqZTctHr5TS0eRYAahtO P2wfZn0k9L6FFZpiOcA8XpRkFBbOo4z01Galt0ml7koUxxGaGryReeeLhqFfDTFP26 /DwKBPAgtrwOZ2207ArhBxJBzsNJGNjXKmARlATjWPQZCVgcm+iWa6ajtchJr5/Vpu R0Wj1gS7lA8Pw== From: Chuck Lever To: Al Viro , Christian Brauner , Jan Kara Cc: , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-cifs@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 Subject: [PATCH v6 04/16] ntfs3: Implement fileattr_get for case sensitivity Date: Tue, 20 Jan 2026 09:24:27 -0500 Message-ID: <20260120142439.1821554-5-cel@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260120142439.1821554-1-cel@kernel.org> References: <20260120142439.1821554-1-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever Report NTFS case sensitivity behavior via the FS_XFLAG_CASEFOLD flag. NTFS always preserves case at rest. Case sensitivity depends on mount options: with "nocase", NTFS is case-insensitive; otherwise it is case-sensitive. Signed-off-by: Chuck Lever --- fs/ntfs3/file.c | 23 +++++++++++++++++++++++ fs/ntfs3/inode.c | 1 + fs/ntfs3/namei.c | 2 ++ fs/ntfs3/ntfs_fs.h | 1 + 4 files changed, 27 insertions(+) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 2e7b2e566ebe..6562768f4574 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -146,6 +146,28 @@ long ntfs_compat_ioctl(struct file *filp, u32 cmd, unsigned long arg) } #endif +/* + * ntfs_fileattr_get - inode_operations::fileattr_get + */ +int ntfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa) +{ + struct inode *inode = d_inode(dentry); + struct ntfs_sb_info *sbi = inode->i_sb->s_fs_info; + + /* Avoid any operation if inode is bad. */ + if (unlikely(is_bad_ni(ntfs_i(inode)))) + return -EINVAL; + + /* + * NTFS preserves case (the default). Case sensitivity depends on + * mount options: with "nocase", NTFS is case-insensitive; + * otherwise it is case-sensitive. + */ + if (sbi->options && sbi->options->nocase) + fa->fsx_xflags |= FS_XFLAG_CASEFOLD; + return 0; +} + /* * ntfs_getattr - inode_operations::getattr */ @@ -1460,6 +1482,7 @@ const struct inode_operations ntfs_file_inode_operations = { .get_acl = ntfs_get_acl, .set_acl = ntfs_set_acl, .fiemap = ntfs_fiemap, + .fileattr_get = ntfs_fileattr_get, }; const struct file_operations ntfs_file_operations = { diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 0a9ac5efeb67..205083e8a6e0 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -2089,6 +2089,7 @@ const struct inode_operations ntfs_link_inode_operations = { .get_link = ntfs_get_link, .setattr = ntfs_setattr, .listxattr = ntfs_listxattr, + .fileattr_get = ntfs_fileattr_get, }; const struct address_space_operations ntfs_aops = { diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index 3b24ca02de61..d09414711016 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -519,6 +519,7 @@ const struct inode_operations ntfs_dir_inode_operations = { .getattr = ntfs_getattr, .listxattr = ntfs_listxattr, .fiemap = ntfs_fiemap, + .fileattr_get = ntfs_fileattr_get, }; const struct inode_operations ntfs_special_inode_operations = { @@ -527,6 +528,7 @@ const struct inode_operations ntfs_special_inode_operations = { .listxattr = ntfs_listxattr, .get_acl = ntfs_get_acl, .set_acl = ntfs_set_acl, + .fileattr_get = ntfs_fileattr_get, }; const struct dentry_operations ntfs_dentry_ops = { diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index a4559c9f64e6..a578b75f31fc 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -504,6 +504,7 @@ extern const struct file_operations ntfs_dir_operations; extern const struct file_operations ntfs_legacy_dir_operations; /* Globals from file.c */ +int ntfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa); int ntfs_getattr(struct mnt_idmap *idmap, const struct path *path, struct kstat *stat, u32 request_mask, u32 flags); int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, -- 2.52.0