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 BE9CE3803C4; Mon, 12 Jan 2026 17:46:47 +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=1768240007; cv=none; b=NqAhqbh4y8RSkiBDWWirD3Rugf1CO/qJy6G21+RToRHxHA0jcefqGjtx3twAY419nDvPoq6aqDhKcx2aXi06gsNsUntci65/EvU4NVI/N5BhuUSDjalrvMOxzTZJddnBvVrA1hgyaezCQSPIF9o9sEdxT0bLiGxdrWVxdkXewd8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768240007; c=relaxed/simple; bh=vkKjAuMgbAEoC7xFjvAv5oDPJFcXyLOZWxANWYd5vGo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e11T1nyvEL3FKIS112QL0ldm2CCMS7G2S8JSKgJ4jcnV7Lu+f13gklT7yEZmItNCmF6H0qy4728ZQNcE4RTj8gBRZNd8Qq6IDVhau7zn5pu62Ypcy5EDOHtSz7nytCYlNUxX9KAaEfIIueb/rgyWpBUC9NrUuGke/om+6w2eeOc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z+Ua5wCk; 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="Z+Ua5wCk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE6F8C116D0; Mon, 12 Jan 2026 17:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768240007; bh=vkKjAuMgbAEoC7xFjvAv5oDPJFcXyLOZWxANWYd5vGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z+Ua5wCk/sOw2tNeJsV55POLlNtK7Ws4czrhw+DC1hGarJ0I2vuT7J6lIFLJnt/Nj DeRl3AfK5T8ef3vZpzYlPabs5Ro+Y8ejwkKji7NJoi2uJpyQp9kN5j3ZVh+HL8XNIA HSpA79pygnLqQqXEBbYXVd8oaIGXiK0C94HMfbmZcROScVDVrnpM0fdXRjMUKwg1cp FVAhZ+3W+8YCANpLGKA5cAUAedGSjKhEZVtFM3SBg9Czf6CRV7RPqzIwr3D2yyQXw9 1ag+ILuPdpGWJhAkHlBg2NsIIn09q52oIx4+LtPnH2Mi2TQ6kO+3vnpbjiEKibLkw4 oEdiIu8X51B0A== From: Chuck Lever To: vira, 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 v3 04/16] ntfs3: Implement fileattr_get for case sensitivity Date: Mon, 12 Jan 2026 12:46:17 -0500 Message-ID: <20260112174629.3729358-5-cel@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260112174629.3729358-1-cel@kernel.org> References: <20260112174629.3729358-1-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-cifs@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 file_kattr boolean fields. 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..cc37a9386d93 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. Case sensitivity depends on mount options: + * with "nocase" mount option, NTFS is case-insensitive; + * otherwise it is case-sensitive. + */ + fa->case_insensitive = sbi->options && sbi->options->nocase; + fa->case_preserving = true; + 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16848CF45B2 for ; Mon, 12 Jan 2026 17:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-ID:Date:To:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QviCeR7ux02OFsWWht3TtUOtbQwkvOrt2/YtrEOO3dM=; b=MpKFTyGdH9G1P7juRFHUKvoOBJ 2elztAmcILlumpmVKl+hcpKfO0zNoxjqQxc3QTM8Fqg/VBCWJ5oczGEYAl8FGBHMqytyyyAD6otEj A++iNUgq8Qk4M5KmbZX6LKXzzp1F5F6+oqjkWe8Bpo0DJpZOShFWRmwI+QN18AAwVolY=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vfM0J-0003mW-MO; Mon, 12 Jan 2026 17:46:59 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vfM0I-0003mQ-9n for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 Jan 2026 17:46:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cHix2Ddla62NxJOcgAVuqLd3IHbcRxB3NU8i8YyUs0Y=; b=PWWlcCsNXg/u3zMgLs7R9MVIhi QhmzkEsAiXc6npJbx63GMX5tT11WX5woQrFwwcD2DoyLmWVaJWWy5DrU8vT7NY1cckNWEgn7t6OkO xkykKWf8Wnwh6BXxwkbs5L0Zd0kANveUSn8guMT1awnZKUXxOl2yZw6v7NlfwZG9B9yI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=cHix2Ddla62NxJOcgAVuqLd3IHbcRxB3NU8i8YyUs0Y=; b=BTgqWpG6pixKTzdU6yKLOOiccT OFRokn9iPfkg6QyI7PD2G1zgqh+UGk+QJnu+qZK7gddqycUDDJwqgvqz1becP0sZM6c/fF3Hov+47 SMe7yGvzr1HN+rbxEopTiQ5Y81wLjQpxGfIv5QAF1NuZdv96T6AnmlIFpme+pvAARC+0=; Received: from sea.source.kernel.org ([172.234.252.31]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vfM0H-0008T4-Q2 for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 Jan 2026 17:46:58 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 73174443EA; Mon, 12 Jan 2026 17:46:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE6F8C116D0; Mon, 12 Jan 2026 17:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768240007; bh=vkKjAuMgbAEoC7xFjvAv5oDPJFcXyLOZWxANWYd5vGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z+Ua5wCk/sOw2tNeJsV55POLlNtK7Ws4czrhw+DC1hGarJ0I2vuT7J6lIFLJnt/Nj DeRl3AfK5T8ef3vZpzYlPabs5Ro+Y8ejwkKji7NJoi2uJpyQp9kN5j3ZVh+HL8XNIA HSpA79pygnLqQqXEBbYXVd8oaIGXiK0C94HMfbmZcROScVDVrnpM0fdXRjMUKwg1cp FVAhZ+3W+8YCANpLGKA5cAUAedGSjKhEZVtFM3SBg9Czf6CRV7RPqzIwr3D2yyQXw9 1ag+ILuPdpGWJhAkHlBg2NsIIn09q52oIx4+LtPnH2Mi2TQ6kO+3vnpbjiEKibLkw4 oEdiIu8X51B0A== To: vira, Christian Brauner , Jan Kara Date: Mon, 12 Jan 2026 12:46:17 -0500 Message-ID: <20260112174629.3729358-5-cel@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260112174629.3729358-1-cel@kernel.org> References: <20260112174629.3729358-1-cel@kernel.org> MIME-Version: 1.0 X-Headers-End: 1vfM0H-0008T4-Q2 Subject: [f2fs-dev] [PATCH v3 04/16] ntfs3: Implement fileattr_get for case sensitivity X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Chuck Lever via Linux-f2fs-devel Reply-To: Chuck Lever Cc: pc@manguebit.org, yuezhang.mo@sony.com, cem@kernel.org, almaz.alexandrovich@paragon-software.com, adilger.kernel@dilger.ca, linux-cifs@vger.kernel.org, sfrench@samba.org, slava@dubeyko.com, linux-ext4@vger.kernel.org, linkinjeon@kernel.org, sprasad@microsoft.com, frank.li@vivo.com, ronniesahlberg@gmail.com, glaubitz@physik.fu-berlin.de, jaegeuk@kernel.org, hirofumi@mail.parknet.co.jp, linux-nfs@vger.kernel.org, tytso@mit.edu, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, senozhatsky@chromium.org, Chuck Lever , hansg@kernel.org, anna@kernel.org, linux-fsdevel@vger.kernel.org, sj1557.seo@samsung.com, trondmy@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net From: Chuck Lever Report NTFS case sensitivity behavior via the file_kattr boolean fields. 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..cc37a9386d93 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. Case sensitivity depends on mount options: + * with "nocase" mount option, NTFS is case-insensitive; + * otherwise it is case-sensitive. + */ + fa->case_insensitive = sbi->options && sbi->options->nocase; + fa->case_preserving = true; + 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel