{"id":2228059,"url":"http://patchwork.ozlabs.org/api/patches/2228059/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260424-case-sensitivity-v11-9-de5619beddaf@oracle.com/","project":{"id":8,"url":"http://patchwork.ozlabs.org/api/projects/8/?format=json","name":"Linux ext4 filesystem development","link_name":"linux-ext4","list_id":"linux-ext4.vger.kernel.org","list_email":"linux-ext4@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260424-case-sensitivity-v11-9-de5619beddaf@oracle.com>","list_archive_url":null,"date":"2026-04-25T01:53:11","name":"[v11,09/15] cifs: Implement fileattr_get for case sensitivity","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a4d2c97e2f6c2a492a9ce11ba9c353ec7797c030","submitter":{"id":86689,"url":"http://patchwork.ozlabs.org/api/people/86689/?format=json","name":"Chuck Lever","email":"cel@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260424-case-sensitivity-v11-9-de5619beddaf@oracle.com/mbox/","series":[{"id":501417,"url":"http://patchwork.ozlabs.org/api/series/501417/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/list/?series=501417","date":"2026-04-25T01:53:02","name":"Exposing case folding behavior","version":11,"mbox":"http://patchwork.ozlabs.org/series/501417/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228059/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228059/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <SRS0=JCc+=CY=vger.kernel.org=linux-ext4+bounces-16091-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=K3MMBa7h;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=jcc+=cy=vger.kernel.org=linux-ext4+bounces-16091-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c15:e001:75::12fc:5321\"\n arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org","gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=K3MMBa7h;\n\tdkim-atps=neutral","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16091-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"K3MMBa7h\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2XwG4DVbz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 11:55:26 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g2XwG3mkPz4w02\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 11:55:26 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4g2XwG3gM6z4wd3; Sat, 25 Apr 2026 11:55:26 +1000 (AEST)","from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4g2XwB6Xhmz4w02\n\tfor <patchwork-incoming@ozlabs.org>; Sat, 25 Apr 2026 11:55:22 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 016393004DBE\n\tfor <patchwork-incoming@ozlabs.org>; Sat, 25 Apr 2026 01:54:10 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 14B87279DC2;\n\tSat, 25 Apr 2026 01:53:47 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id BDCBD23370F;\n\tSat, 25 Apr 2026 01:53:46 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 236A6C2BCB2;\n\tSat, 25 Apr 2026 01:53:44 +0000 (UTC)"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1777082126; cv=pass;\n\tb=eNyx0L0Gw5gd+8Msnbge8jnMXUf5KXZ8HNvA3SXL646ItucSdQloK/NAJ2rUnXyTy+eq6k+/ro8EpP2r2IHqA65JMrzO7zoMDOUwsgvnn2E4ONVjIZu5ycLPLxFOB+6v9iRw/nidSyRHV8f9NsKPQirjQKLo+NtDrJGxmMcxSHoJiji/vQlWtPJGnW5F/wu1fXPl/FxzHy96eNy9f7ruUaE/eVua4i7rj9LmgPxKU+YCglS53ewvskMigFOEfqWPufAufMCA6h87Yo187AnIL3iPlvl8hbj2j7yAWIhmzIEwcI6X94DwiqygVnGnkTaqi5lcm91bm77kfAB/Z4WP7Q==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777082026; cv=none;\n b=iM082svpC+cBNq53cm+2XqHV0FCXC8wLbzH4WI/EXkb43rD2n/o3KUcUE+MxPO6yBbud2adcfCOcFzPDPaH08T9yO37QyG0qjYpja0CqFOejaZFKrovbjYN/qphxbXIxPi6YJJY6/DEh4xOVrQi0jTvAJrv3+Vik/NcuoBfB/D4="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1777082126; c=relaxed/relaxed;\n\tbh=ciLWG6SbVL2BRXZiZC3HqhmcQhn00hDA6N5ATitwl0w=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=N0juubKRCAJrkv2nYNrWFE0ed030JR6fuK+1I2Ys36YgZMpsG3FI6ckqAQOY9WWqi+mJGfmCY+bLKIvmj/s+B0kq1NpUFFkbFeY1Hyy6ZQ/8EBhT6bkFJnlvCFPm5JBzniNyNF3nDDTgtmbgvd4oLiFZfLAzKj71uOD3sqK7TqtDIT/Pi4+eAmSGuziKVEjr1ZpZUjL89L6WpLuen9eA5QLt2e+Kl5YFzw2bnrtGC9unmMPzIoCBKWwZSZomZ0I1prku/Wg2UD542Xt8zTrk6OAuE7vgdEzjBuIXKHXHtpK2uUMMsPGOKOcnc4M+KOX4imZXc2IU1M2VzHfrjNsDBA==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777082026; c=relaxed/simple;\n\tbh=iqVtUvA2aKvU7uqHLJI96q1iBGdaqv4WpR0C8NAdAPI=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=YGV1OIZREWvJS4DaGd2k4anl/8sh0c7cwobBvNCqwu0DvvyXRymWi+7IBmv9BQx6opa+/Kq7/d3R+0ZksTI/MvlFPSC2H7Yhs+go3uAdGsTHacnbV8XnnLki4KP1SlsMzy9/PSVq4PNUGp+i4mA5cvLlaAaDIRpPhUVxUi6EP1o="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=K3MMBa7h; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16091-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=K3MMBa7h; arc=none smtp.client-ip=10.30.226.201"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777082026;\n\tbh=iqVtUvA2aKvU7uqHLJI96q1iBGdaqv4WpR0C8NAdAPI=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=K3MMBa7hmnticXooMQM21l1uNgwFutLxc2Gmx64Ztrd0t7AG/xfAVMFOIe8gPnwVy\n\t xxE1uv1wKye7AMSlbgkzOEsdB1D9prnltSBvN9dtuRePIObwvuQLepWL8OE+HpPpY7\n\t Ldl0BztwODviz4UVRKR/u379rCfy5R1IR1St7/B8SK4ve+OqUrDVif1g+gWe607tqE\n\t r0qgXJyE6Yk/vaQYNgRQFV5EF3/uDhq92Pfg9vxDkylK3hAdcaBdEeRSmtw+0opA5f\n\t x+3WM58uoL26xLv15ab+2CYJIe+BBmlXurIiRU88sZ/icDo5XZepYSm5kNAdlFDCG1\n\t sc2LT4S/abZ+Q==","From":"Chuck Lever <cel@kernel.org>","Date":"Fri, 24 Apr 2026 21:53:11 -0400","Subject":"[PATCH v11 09/15] cifs: Implement fileattr_get for case\n sensitivity","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260424-case-sensitivity-v11-9-de5619beddaf@oracle.com>","References":"<20260424-case-sensitivity-v11-0-de5619beddaf@oracle.com>","In-Reply-To":"<20260424-case-sensitivity-v11-0-de5619beddaf@oracle.com>","To":"Al Viro <viro@zeniv.linux.org.uk>,\n Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>","Cc":"linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,\n linux-xfs@vger.kernel.org, linux-cifs@vger.kernel.org,\n linux-nfs@vger.kernel.org, linux-api@vger.kernel.org,\n linux-f2fs-devel@lists.sourceforge.net, hirofumi@mail.parknet.co.jp,\n linkinjeon@kernel.org, sj1557.seo@samsung.com, yuezhang.mo@sony.com,\n almaz.alexandrovich@paragon-software.com, slava@dubeyko.com,\n glaubitz@physik.fu-berlin.de, frank.li@vivo.com, tytso@mit.edu,\n adilger.kernel@dilger.ca, cem@kernel.org, sfrench@samba.org,\n pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com,\n trondmy@kernel.org, anna@kernel.org, jaegeuk@kernel.org, chao@kernel.org,\n hansg@kernel.org, senozhatsky@chromium.org,\n Chuck Lever <chuck.lever@oracle.com>, Steve French <stfrench@microsoft.com>,\n Roland Mainz <roland.mainz@nrubsig.org>","X-Mailer":"b4 0.16-dev","X-Developer-Signature":"v=1; a=openpgp-sha256; l=4927;\n i=chuck.lever@oracle.com; h=from:subject:message-id;\n bh=whZ8I7ut1VTIHU0vKs6CtPNqzIY9szgQN51EcCcpO08=;\n b=owEBbQKS/ZANAwAKATNqszNvZn+XAcsmYgBp7B6QSmpPLePycgQR+X9KRG/phCkNRX1KfUFc1\n t2neUXuimiJAjMEAAEKAB0WIQQosuWwEobfJDzyPv4zarMzb2Z/lwUCaewekAAKCRAzarMzb2Z/\n l+CDD/0a6m3um2MGo56wuLNvdlF3IKwxmf0b1QEHljHVtUdH3arHVqy+JkeGc3Nxf2PBQMG8QIw\n 5uXHMcRUvy9gSRP4+2zu1xi1NglLNwtWcb23R2t1g9lswqc7SyqtUxeqnu31zZIVHSehQfadUiv\n Fe9Uvn+D7ZWcdcExqGvz50opYvX5ZVR17IB/tJ4Ydrxkhl+Yuna8x21PDvZAFL2mhwCyshAjp2G\n d0ARfQxgAoGqPC9pcmEVp1wAMMYj1tqIuAESPm+Ce4OP33bXkdSApOAv5PGTKBs3+YMKbAoNf22\n QyllvOgoNwkv/etZArfw6YIUdg8rwuue6WwqYgSwdRAde0saMEZ5dfmhv8O25yXytNsVH1XKjl1\n Rk6WLsSsihQCQQvpZy9r/W26+sjV7lfXVZuF99u3mKv+Y3nrFsjDGuMux9m+sHg/lxu9oOwMJ3q\n fYobeFNxxEvWNppCrm85eOoPMgCVIQ3SAc9M5l4SFDhc+kn42V3ublxxQJqJ+1Y5PnXepT+FOtr\n h3e5FIkISL/uYL3OU0YxtI2iG9BQrEWIgmSfMzAuB4nnTioRpfGH0deQQ5Wo9FGSRd1VQK8DcSm\n MPaeRjLYha8eqSmNt9IVm9+2/+Vn1bF5DdDv3+k+OMBtpuWqRh7c3DokNj9zkxeV9A4UuCrWCYP\n 1Xvn5BVT6g8cEgg==","X-Developer-Key":"i=chuck.lever@oracle.com; a=openpgp;\n fpr=28B2E5B01286DF243CF23EFE336AB3336F667F97","X-Spam-Status":"No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"},"content":"From: Chuck Lever <chuck.lever@oracle.com>\n\nUpper layers such as NFSD need a way to query whether a filesystem\nhandles filenames in a case-sensitive manner. Report CIFS/SMB case\nhandling behavior via FS_XFLAG_CASEFOLD and\nFS_XFLAG_CASENONPRESERVING.\n\nThe authoritative source is the server itself: at mount time CIFS\nissues QueryFSInfo(FS_ATTRIBUTE_INFORMATION) and caches the reply\non the tcon. That reply carries FILE_CASE_SENSITIVE_SEARCH and\nFILE_CASE_PRESERVED_NAMES, which reflect whatever case handling\nthe share actually implements after SMB3.1.1 POSIX extensions\nnegotiation. Translating those two bits into the VFS flags lets\ncifs_fileattr_get report what the server advertises rather than\nwhat the client was asked to pretend.\n\nQueryFSInfo is best-effort; the mount completes even if the server\ndoes not answer. MaxPathNameComponentLength is zero in that case\nand is used as the \"no reply received\" sentinel. When no reply is\navailable, fall back to the nocase mount option so that the reported\nbehavior agrees with the dentry comparison operations installed on\nthe superblock.\n\nThe callback is registered in all three inode_operations structures\n(directory, file, and symlink) to ensure consistent reporting across\nall inode types.\n\nRegistering fileattr_get routes FS_IOC_GETFLAGS through\nvfs_fileattr_get() and short-circuits the syscall's fallback to\ncifs_ioctl(). That fallback invoked CIFSGetExtAttr() under\nCONFIG_CIFS_POSIX and CONFIG_CIFS_ALLOW_INSECURE_LEGACY on servers\nadvertising CIFS_UNIX_EXTATTR_CAP, surfacing the SMB1 Unix-extension\nimmutable, append, and nodump bits. cifs_fileattr_get carries over\nonly FS_COMPR_FL from cached cifsAttrs; the SMB1 extattr fetch is\nnot reproduced. SMB1 is deprecated, and acquiring a netfid from\nwithin a dentry-only callback is not worth preserving a path tied\nto an insecure legacy dialect.\n\nAcked-by: Steve French <stfrench@microsoft.com>\nReviewed-by: Roland Mainz <roland.mainz@nrubsig.org>\nSigned-off-by: Chuck Lever <chuck.lever@oracle.com>\n---\n fs/smb/client/cifsfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 42 insertions(+)","diff":"diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c\nindex 2025739f070a..d71755b59b5b 100644\n--- a/fs/smb/client/cifsfs.c\n+++ b/fs/smb/client/cifsfs.c\n@@ -30,6 +30,7 @@\n #include <linux/xattr.h>\n #include <linux/mm.h>\n #include <linux/key-type.h>\n+#include <linux/fileattr.h>\n #include <uapi/linux/magic.h>\n #include <net/ipv6.h>\n #include \"cifsfs.h\"\n@@ -1199,6 +1200,44 @@ struct file_system_type smb3_fs_type = {\n MODULE_ALIAS_FS(\"smb3\");\n MODULE_ALIAS(\"smb3\");\n \n+static int cifs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)\n+{\n+\tstruct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb);\n+\tstruct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);\n+\tu32 attrs = le32_to_cpu(tcon->fsAttrInfo.Attributes);\n+\n+\t/* Preserve FS_COMPR_FL previously reported by cifs_ioctl(). */\n+\tif (CIFS_I(d_inode(dentry))->cifsAttrs & ATTR_COMPRESSED)\n+\t\tfa->flags |= FS_COMPR_FL;\n+\n+\t/*\n+\t * The server's FS_ATTRIBUTE_INFORMATION response, cached on\n+\t * the tcon at mount, reflects the share's case-handling\n+\t * semantics after any POSIX extensions negotiation. Prefer\n+\t * it over the client-local nocase mount option, which only\n+\t * governs dentry comparison on this superblock.\n+\t *\n+\t * QueryFSInfo is best-effort at mount; when it did not\n+\t * populate fsAttrInfo, MaxPathNameComponentLength remains\n+\t * zero. In that case fall back to nocase so the reporting\n+\t * matches the comparison behavior installed on the sb.\n+\t */\n+\tif (le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength) == 0) {\n+\t\tif (tcon->nocase) {\n+\t\t\tfa->fsx_xflags |= FS_XFLAG_CASEFOLD;\n+\t\t\tfa->flags |= FS_CASEFOLD_FL;\n+\t\t}\n+\t\treturn 0;\n+\t}\n+\tif (!(attrs & FILE_CASE_SENSITIVE_SEARCH)) {\n+\t\tfa->fsx_xflags |= FS_XFLAG_CASEFOLD;\n+\t\tfa->flags |= FS_CASEFOLD_FL;\n+\t}\n+\tif (!(attrs & FILE_CASE_PRESERVED_NAMES))\n+\t\tfa->fsx_xflags |= FS_XFLAG_CASENONPRESERVING;\n+\treturn 0;\n+}\n+\n const struct inode_operations cifs_dir_inode_ops = {\n \t.create = cifs_create,\n \t.atomic_open = cifs_atomic_open,\n@@ -1217,6 +1256,7 @@ const struct inode_operations cifs_dir_inode_ops = {\n \t.listxattr = cifs_listxattr,\n \t.get_acl = cifs_get_acl,\n \t.set_acl = cifs_set_acl,\n+\t.fileattr_get = cifs_fileattr_get,\n };\n \n const struct inode_operations cifs_file_inode_ops = {\n@@ -1227,6 +1267,7 @@ const struct inode_operations cifs_file_inode_ops = {\n \t.fiemap = cifs_fiemap,\n \t.get_acl = cifs_get_acl,\n \t.set_acl = cifs_set_acl,\n+\t.fileattr_get = cifs_fileattr_get,\n };\n \n const char *cifs_get_link(struct dentry *dentry, struct inode *inode,\n@@ -1261,6 +1302,7 @@ const struct inode_operations cifs_symlink_inode_ops = {\n \t.setattr = cifs_setattr,\n \t.permission = cifs_permission,\n \t.listxattr = cifs_listxattr,\n+\t.fileattr_get = cifs_fileattr_get,\n };\n \n /*\n","prefixes":["v11","09/15"]}