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 8299DD3EE8A for ; Thu, 22 Jan 2026 16:03:50 +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=LjJc53ekqqQU27nWM/nKFfXAe6OLnTTSHRr5f4iV7wQ=; b=UqnA3wlTKlLU+0tSBn/CO/LNCh bdX1hIbjVe5EUDOoazdPevKurmeutjar/sfa/3jD0lcE9WDhdPuXV0Mrwmtpy+Gg7Qxc88A4FqQbW PjOS/X1jlxRcmBcFgRw6O/ScugR+1sAxXcEr1nzr8Zw7VOi54LRMyGjj7BCgdpzK2Y1Y=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vix9y-0000yy-6E; Thu, 22 Jan 2026 16:03:50 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vix9x-0000yp-C0 for linux-f2fs-devel@lists.sourceforge.net; Thu, 22 Jan 2026 16:03:49 +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=tq+jroHPfBFKSZcHz3V58ZQAiJ8Y4IUU4s3En3If38A=; b=JKpD51iZzoqK41XE8CaSko4a7g yG0K6b9t6ajXhNYdpXR2idwTvVgSsplcu/o8ha/LKggSUrKm37fl8XIXdlZP1usNwI0RcWf/xI1Vl 8D06kk/8fk3RGu7sGGRghoewVpVC7SAmrf57VUWhonzNYWEwQUcyOXWH6SY1198Wo17c=; 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=tq+jroHPfBFKSZcHz3V58ZQAiJ8Y4IUU4s3En3If38A=; b=a/QJtVrSucuRfP1YXD70/kN6Vq Upa0+MUXrnapx1JynmxUw2Rb6MXVxEwQdCX0hKOss22pMuFoTuQjO2zPPo09imyt8vrKue2ysc1W8 NJpbgu4dULfocvIUXtWxZmFO9A1ArmahNBRJ5dcnx6MynjipT/G2Q1mRQ6hy3FPHATtY=; 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 1vix9w-0000WG-S3 for linux-f2fs-devel@lists.sourceforge.net; Thu, 22 Jan 2026 16:03:49 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 91B7B40802; Thu, 22 Jan 2026 16:03:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B4B0C116D0; Thu, 22 Jan 2026 16:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769097818; bh=vo+ZsaKAK/vmxsw0XxmdeStjATZWutMATw6PeQlNXOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ive8vpihKT3C+OwU5VtIASW5NNK17qKQvjofXk9ZbwSkuUi6qObOLLy43qeCycnvg VI244SnMONYOv3cCrSz1zLBjW3DuLfJbbwyTK1tvF+7bczHzbxHg7WHs2D1EQ9jbXs 3Y7sLwIAQ7w+an8tl9gLifWuOZyNBt2Dedywx9jH7pIzV+qfNDJFehMNpRl4KcDSF0 T9AnxYIy3ce91fOG36XwTtVfApPtp+6HlEgaN5cQK4/ZBIWB6UhcxjV0rzSZM4K8Jj haLFAHCZkd6Y3RUju9YLU499jLmSeQwewVeu/584nVqJW+0EgUj4yP6p8RxZvsTO3H 2KJg7fJDm5TCQ== To: Al Viro , Christian Brauner , Jan Kara Date: Thu, 22 Jan 2026 11:03:04 -0500 Message-ID: <20260122160311.1117669-10-cel@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260122160311.1117669-1-cel@kernel.org> References: <20260122160311.1117669-1-cel@kernel.org> MIME-Version: 1.0 X-Headers-End: 1vix9w-0000WG-S3 Subject: [f2fs-dev] [PATCH v7 09/16] cifs: 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-api@vger.kernel.org, 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 Upper layers such as NFSD need a way to query whether a filesystem handles filenames in a case-sensitive manner. Report CIFS/SMB case handling behavior via the FS_XFLAG_CASEFOLD flag. CIFS servers (typically Windows or Samba) are usually case-insensitive but case-preserving, meaning they ignore case during lookups but store filenames exactly as provided. The implementation reports case sensitivity based on the nocase mount option, which reflects whether the client expects the server to perform case-insensitive comparisons. When nocase is set, the mount is reported as case-insensitive. The callback is registered in all three inode_operations structures (directory, file, and symlink) to ensure consistent reporting across all inode types. Signed-off-by: Chuck Lever --- fs/smb/client/cifsfs.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c index d9664634144d..39426a128b3d 100644 --- a/fs/smb/client/cifsfs.c +++ b/fs/smb/client/cifsfs.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include "cifsfs.h" @@ -1193,6 +1194,22 @@ struct file_system_type smb3_fs_type = { MODULE_ALIAS_FS("smb3"); MODULE_ALIAS("smb3"); +static int cifs_fileattr_get(struct dentry *dentry, struct file_kattr *fa) +{ + struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb); + struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); + + /* + * Case sensitivity is reported based on the nocase mount option. + * CIFS servers typically perform case-insensitive lookups while + * preserving case in stored filenames. The nocase option indicates + * case-insensitive comparison is in effect for this mount. + */ + if (tcon->nocase) + fa->fsx_xflags |= FS_XFLAG_CASEFOLD; + return 0; +} + const struct inode_operations cifs_dir_inode_ops = { .create = cifs_create, .atomic_open = cifs_atomic_open, @@ -1210,6 +1227,7 @@ const struct inode_operations cifs_dir_inode_ops = { .listxattr = cifs_listxattr, .get_acl = cifs_get_acl, .set_acl = cifs_set_acl, + .fileattr_get = cifs_fileattr_get, }; const struct inode_operations cifs_file_inode_ops = { @@ -1220,6 +1238,7 @@ const struct inode_operations cifs_file_inode_ops = { .fiemap = cifs_fiemap, .get_acl = cifs_get_acl, .set_acl = cifs_set_acl, + .fileattr_get = cifs_fileattr_get, }; const char *cifs_get_link(struct dentry *dentry, struct inode *inode, @@ -1254,6 +1273,7 @@ const struct inode_operations cifs_symlink_inode_ops = { .setattr = cifs_setattr, .permission = cifs_permission, .listxattr = cifs_listxattr, + .fileattr_get = cifs_fileattr_get, }; /* -- 2.52.0 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel