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 C5F8AE9A04A for ; Tue, 17 Feb 2026 21:48:24 +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=N9D99lDZJzdepQzQ2i8uHtNvy1SC5QKCFszRfT0Clwc=; b=RjG8zOlLkQeH4z3LjI6Q4Is3PX IzbamEK1lAgDQXJUxYGq+84y7CT+gHrL2YIvhP/KMhu89litd1B8M1mQOR8G4LEY9IH7WiMqA5NSD hUmXZPrOYCxNfZekEkkR2EG2gxtezZL0tA0U8K9QlMbg8wBVnnjdFGMKtEAiA9J6dMLk=; 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 1vsSvg-00077G-G3; Tue, 17 Feb 2026 21:48:24 +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 1vsSvf-000777-F0 for linux-f2fs-devel@lists.sourceforge.net; Tue, 17 Feb 2026 21:48:23 +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=vkuMMUQ1+uFjnEerP+sbQkssOKyGNLkV9tW/wSnzlAg=; b=eXvMf+TDciyOTcCVopuF8zMAR6 /JPVDbSZSHPDnU7iW5/eGw8Hsk63e3qf8v5bh61TwO/7UE+aFa/MWoG8zYwUZiUd+ibIe0qRjFZjj fzGqSTyDxAJ+Q3+nzOWARK05ESOOPhXypqzsMjYWgq/LlqDiTSIOvc3wcpnGnlQuPz/s=; 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=vkuMMUQ1+uFjnEerP+sbQkssOKyGNLkV9tW/wSnzlAg=; b=hHc0K/vJJMPWQ7/gIzUvYE+Ya7 bNt5y6zzFbeALb/G9yL2iyxblCSadGC/yjctur4wHTnexnFwWJUiqM/HZkg7mu2pNbbNyrcWB6uWW zoP8z/Qf15ZXL9k+6yBEABS7zq+e9P7pwr0nVkJ0rNA9xOIWoWIvQ4dO7UhMO1vdHg1A=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vsSve-0002tA-Om for linux-f2fs-devel@lists.sourceforge.net; Tue, 17 Feb 2026 21:48:23 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 9CA2561859; Tue, 17 Feb 2026 21:48:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 119F0C4CEF7; Tue, 17 Feb 2026 21:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771364891; bh=5J2/6flRB909Ns0eqSfrHWl5jUmbSKDChds8uNX1o+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u6t+2zKw/OruF4yK6QrMVZv/p9opIcZqoTW4zBnJEZ/v54wYSALunMMB3TrlDvduJ Qxcd+ZBu0V/alHR3HQCd4VBDT8cXkC+uSdh+Lk0Wg8hcIipmwRYjdZ26XIoze9mfhH RGUetd0fZE30GAHmVg9GWx5iQQGetUv0aTS9A4P4yS2Kr5bRbRqkO0yfXpngNyrRqO X9VM2MhU4qxJzgRWXbSqFHmPWylByjwsTg4egbKHAuxCemu93scSVR2C+sjpVBBa9c L48xM0deidoXI7mI8CNJgBUerIxnQ8+AnKS2FhN+HhCel32Txo9XxiZZeUp10jtloj QOgLsfj64LcqQ== To: Al Viro , Christian Brauner , Jan Kara Date: Tue, 17 Feb 2026 16:47:34 -0500 Message-ID: <20260217214741.1928576-11-cel@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260217214741.1928576-1-cel@kernel.org> References: <20260217214741.1928576-1-cel@kernel.org> MIME-Version: 1.0 X-Headers-End: 1vsSve-0002tA-Om Subject: [f2fs-dev] [PATCH v8 10/17] 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 afda1d7c1ee1..9d85785a1c67 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" @@ -1189,6 +1190,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, @@ -1206,6 +1223,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 = { @@ -1216,6 +1234,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, @@ -1250,6 +1269,7 @@ const struct inode_operations cifs_symlink_inode_ops = { .setattr = cifs_setattr, .permission = cifs_permission, .listxattr = cifs_listxattr, + .fileattr_get = cifs_fileattr_get, }; /* -- 2.53.0 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel