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 5FD1EFAD3E4 for ; Wed, 22 Apr 2026 23:30:49 +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:To:In-Reply-To:References:Message-Id: MIME-Version:Date:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YpLhBJRAGjbDwzasHLyFXScXXH6EzrlWFY7yRNl7aw8=; b=Xmmjj8dAy8VSwkbt4qpKCTT8pq DxzpJHd8g01OeAu8pnCunB55+u7OBUICmYajH/8DnADwOuzLBwsFutSvODyQ0geSkq/s0BY2lrzSK JNb0eE4K1boSSYnVjjTpw0ThAyNigm+wQ9/o2rYDbUJY+s0gRhMhjjHcqrg3CH0QnugM=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wFh1v-0001rG-HS; Wed, 22 Apr 2026 23:30:49 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wFh1t-0001r6-VB for linux-f2fs-devel@lists.sourceforge.net; Wed, 22 Apr 2026 23:30:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=S6+imjlL7+BXTjIfYyqGCuBDg6ro6Dr3lwiwezjgAWA=; b=QL0t68XkEsHqhjFtZY5wfkY8rd wO9pQdiYiWiCramIaSs8soFIUEg//SuItqegNFs5ANDf3NGpjYcQRF+efFfX8BSLgzNB/bpPYuP67 XYPOA0iLJYGhffSvvMIBEOMP23ypuZjSG0TwgHawGHQFzmYTiYXyxTUcwqz3KmBeitqM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To: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=S6+imjlL7+BXTjIfYyqGCuBDg6ro6Dr3lwiwezjgAWA=; b=KvV5HElr44wSOqSa8ZVYeIExrn vK6FKKYTfCb4xAodgQKFIHvkxA4Kk2CT5Eh7wBk+4xelvxrifTNxR86/kexeKk5NZoaFYabzptUmO y9C1XNpzP2LIpv5S012wY2p/K7No557eAKhe8XK0kwgCf52ttLgYnp6NJlzI9ZRpttTI=; 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 1wFh1q-0006e9-Ir for linux-f2fs-devel@lists.sourceforge.net; Wed, 22 Apr 2026 23:30:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 401C440958; Wed, 22 Apr 2026 23:30:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E69EEC2BCB4; Wed, 22 Apr 2026 23:30:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776900641; bh=3FDGIbyd53hieTFjHcvjm5nzg+D7ONlzAFyULte93sg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=vE9qOI1Sv3eEEQbTnMhAdvgAPFVNBB8eyOmJISRYI8Es6gRuR8yDUFqmj9bm7DMxi a98lClsih+0h8JdzHKdnTtLERNelh3ovsyoUuZw9lMaVq4+O7VcGybWCrwy+cfQ8st YMrVopGGJlHOPR0/UaYwC+q1BlA3X0xKmCAKrg22XaOk5yQKqx05jx2q8XCPCiSlIF SMFXYY+60TKlJYBbHaYMNtN3NHCRCGyPknFipeS4TSv3Ip/aadAvZS9mljjkUxCVNx AgX3ddjqjh68xVkMFMP7EK1otdlubwVGtwrswCe8HU5iLHM+5Xkt3Z7ENUHHbGLfjw WugcZz4oQGIhA== Date: Wed, 22 Apr 2026 19:30:04 -0400 MIME-Version: 1.0 Message-Id: <20260422-case-sensitivity-v9-10-be023cc070e2@oracle.com> References: <20260422-case-sensitivity-v9-0-be023cc070e2@oracle.com> In-Reply-To: <20260422-case-sensitivity-v9-0-be023cc070e2@oracle.com> To: Al Viro , Christian Brauner , Jan Kara X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2841; i=chuck.lever@oracle.com; h=from:subject:message-id; bh=NHGFFutdF7XUq+F6V/57X13tbeSdQC6FWxwg7Cn1opw=; b=owEBbQKS/ZANAwAKATNqszNvZn+XAcsmYgBp6VoGOIp8bkRnF4kmb5Vb8E8yCgkwTWDUH1XIY FZmPD9guTuJAjMEAAEKAB0WIQQosuWwEobfJDzyPv4zarMzb2Z/lwUCaelaBgAKCRAzarMzb2Z/ l6AYD/95c629HAYMskEDv6EbLOg7b/4PdO9vAfj+Remfjt9CYqLZvGYeHRVnbSqj4dNuks55fSB DVxWxX2hRviI6Y9AnJBx0xyHDXp+3lUUT02TFBfuOll4bJ8oV2wlRuNJ0uAnXtQpv1tTcmPPFc2 cdPwV5zmlNxNeL9cQuNYaPy+xT33MnqkvlmM+9OU9/XVn4mEi2EPTNtfWp1XcBLdOgRlLY6je4i lPDHzG7JGBhBC6AQJBf3yyaRD3YUn54e56WKiGgSqAz4IqOtR0vqhrNLSZrQPzWp8ZjEW80Ud1e nfvWhTjLXoTyKTUrCGNActqia/X2M6Gu0P+9GnJeWDtOcDu9CyS8KwsNPdWj1Hm12pECYhBhddP Ius5AYvAsnq1vkSgYAPeMQxMz9fgr01BW7g25lBn1hS8d6ieElEYfPu+3urr1UxCS4DA3FVjq0d bHdGfd5m858vQtxbprsaifDAiei0ZlHGedpcwgdi6x2BXjpjL/ZL444lzluge5F2P8gMTZRe+3d SnMBVQMuEQt3KgKLPpKlvqP6TdcEE/sUoP1FYYwPrDZ4X11ng+VNEjYRLZFe8KVaBfZ9aC5MT48 Ght4dWsn2Nt6iziswdU/jSaqy+DtZIMFqO2//pc1gnkyZp7l/gHK5MjUiDUXkkGZVO9kv4Rrqml +B1DB2l+LXtmazw== X-Developer-Key: i=chuck.lever@oracle.com; a=openpgp; fpr=28B2E5B01286DF243CF23EFE336AB3336F667F97 X-Headers-End: 1wFh1q-0006e9-Ir Subject: [f2fs-dev] [PATCH v9 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 2025739f070a..9b70ffa3e01d 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" @@ -1199,6 +1200,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); + + /* + * The nocase mount option installs case-insensitive dentry + * operations on this superblock. SMB preserves case on the + * wire and at rest, so the mount matches FS_XFLAG_CASEFOLD + * semantics: case-folded lookup, verbatim storage. + */ + 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, @@ -1217,6 +1234,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 = { @@ -1227,6 +1245,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, @@ -1261,6 +1280,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