{"id":2230444,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2230444/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260429-case-sensitivity-v12-10-8057123bebe0@oracle.com/","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/1.1/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260429-case-sensitivity-v12-10-8057123bebe0@oracle.com>","date":"2026-04-29T18:07:21","name":"[v12,10/15] nfs: Implement fileattr_get for case sensitivity","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"6450b0f5388defa1b4ed37fce942831e2b5ccdc0","submitter":{"id":86689,"url":"http://patchwork.ozlabs.org/api/1.1/people/86689/?format=json","name":"Chuck Lever","email":"cel@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260429-case-sensitivity-v12-10-8057123bebe0@oracle.com/mbox/","series":[{"id":502123,"url":"http://patchwork.ozlabs.org/api/1.1/series/502123/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=502123","date":"2026-04-29T18:07:11","name":"Exposing case folding behavior","version":12,"mbox":"http://patchwork.ozlabs.org/series/502123/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2230444/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2230444/checks/","tags":{},"headers":{"Return-Path":"\n <linux-cifs+bounces-11290-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.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=c+tSdyIX;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-cifs+bounces-11290-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"c+tSdyIX\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\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 4g5QPm43cHz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 04:12:28 +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 7699D303ABF1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 18:08:35 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 46B8E423145;\n\tWed, 29 Apr 2026 18:07:54 +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 C1AFF421EF1;\n\tWed, 29 Apr 2026 18:07:53 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id F0EA6C19425;\n\tWed, 29 Apr 2026 18:07:50 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777486073; cv=none;\n b=fwXRzT8ZQnn2GtFqKG2d0wR9zjYHvjsVkhQbwPhUNpYGa1IvuCe9Bpj3K9ioeqK3ov14vGZpm5ynbVvCMeNlJ5ygpczzbfFW0xLAGl9e2DETzorJeOwt4Y9tEyMTvEPvjVUjOu1s/2/GfmStwI+8FGRSkOECIT6et+dD0vR3W1M=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777486073; c=relaxed/simple;\n\tbh=xH3oEcH57CwPmh3i62lzJ2wWcH1LitL9LjGlxJzOGDQ=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=FatJAjzz0+tN7EiBpWNkqL9GPo9GfNZAIFxwNnztvqJSS1BsDLm1Kruc32t6ZW8QYu9XbmrZM6eG5W6KhLspUoOnrK1paJ7F0BOtSJSNnAz73X4u80Tsq3vFz119CRNQMjPYvTfJczhalpZl3K0CA2P+cUqEGwoSi6jBLXs3mCA=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=c+tSdyIX; 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=1777486073;\n\tbh=xH3oEcH57CwPmh3i62lzJ2wWcH1LitL9LjGlxJzOGDQ=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=c+tSdyIXa06PZWeJVDEbw4jsaPNpkqiwrkxyJpHs48yyK7xkAWCPt3x+zrmTra0gk\n\t MNyTkDQ/hlQsovCOvfgAYun91h1vS2sgrfZs9pr6eYfi7QSQUqj1L6GBBekXX93hQQ\n\t pyehOxgV8Mnhz7348ErhOEsTol5eW8//0CrifYYl8v0KvXzMWt35E+yI/4OpZ8hZ0V\n\t uDDEHciBL/TxDoGAcc9wA35XuNVACEkGyyW9FRSVV10O6e+d72U3+46yJ+MhH3K9vv\n\t Eorg7GFwPo6PmZJgR3cnSf+zZ/6Y2nkFiaBiNUhp6VGWcxYMwIKm5HpPoRFbcGyLcN\n\t 7k1ca1I7KrpsA==","From":"Chuck Lever <cel@kernel.org>","Date":"Wed, 29 Apr 2026 14:07:21 -0400","Subject":"[PATCH v12 10/15] nfs: Implement fileattr_get for case sensitivity","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260429-case-sensitivity-v12-10-8057123bebe0@oracle.com>","References":"<20260429-case-sensitivity-v12-0-8057123bebe0@oracle.com>","In-Reply-To":"<20260429-case-sensitivity-v12-0-8057123bebe0@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>,\n Roland Mainz <roland.mainz@nrubsig.org>","X-Mailer":"b4 0.16-dev","X-Developer-Signature":"v=1; a=openpgp-sha256; l=12043;\n i=chuck.lever@oracle.com; h=from:subject:message-id;\n bh=UtT3wJyCGTOomWXza/car6S6T4PH5PQ6wbfmjoAsHtQ=;\n b=owEBbQKS/ZANAwAKATNqszNvZn+XAcsmYgBp8kjdL9+U9tlem+TNnUslLrGbBieDJke0HL5YC\n 1254isrZxWJAjMEAAEKAB0WIQQosuWwEobfJDzyPv4zarMzb2Z/lwUCafJI3QAKCRAzarMzb2Z/\n l0fRD/46wMGDDLPhPt9rMBY+gfyfHJI2vdv8nW/u4f6zoxfT7ULHHnYcSrtGwsesPoYpM8xMKcd\n fKSFHaAbZj8mpnjdrqj+FsmRG406DheegmgUvO9CFmwWhoakGkppf2Rw3C07KNJLchnDzps53O3\n 8sqD8KS5hfrgzIWSVk7rhrCSPaoHUV/gFuJz5w7tIRpffheO7LoNRr+njObk7nTiTES2WBqIb+V\n Qp9og2qhVrazhw7QH1cvTDz0+FaaQ9OIAXPIu1hmQ6EC/Yh8CxJTZMOkDdRHB8rzTRm0lv+1paj\n krvbP6uOI2oGh225r9tOeXwt0iWbldckZi4bXIh5Zovvd7StkkQpe06RCBDY5KRQ45Ek94IAKo3\n 8cLiV7WuITf+f2/rJVGz/cH8YjMGVGIIptGFMHZ4a77Fh/5N+f4sT8hwqRv8o08+kf8Nwf/+v/S\n nI5cHDT0xz1059Kdji6mhSDUyYs1xG2c5V6tqO40rLgcxQXVMjRdd+NqZmxB+/ulzGC+kw46XW7\n AVGDgjYuXaiw6IDZ0YICuHwxm83LYJ+zKtk3zmK+1V1xa2DOb5G+i00HxDD9ZjVDNXVI3HqaSjr\n GghVaw2i2CYvbfqxTzJ+shKwba/bZN/41qXuDsdN2TzTHEQDZIqrkXmu+M5nv5nv/zPcXQGj7Cr\n GIRmOrZ37jwbXYw==","X-Developer-Key":"i=chuck.lever@oracle.com; a=openpgp;\n fpr=28B2E5B01286DF243CF23EFE336AB3336F667F97"},"content":"From: Chuck Lever <chuck.lever@oracle.com>\n\nAn NFS server re-exporting an NFS mount point needs to report\nthe case sensitivity behavior of the underlying filesystem to\nits clients. NFSD's attribute encoder obtains that information\nby calling vfs_fileattr_get() on the lower filesystem, so the\nNFS client must implement fileattr_get to surface what it\nlearned from its own server.\n\nThe NFS client already retrieves case sensitivity information\nfrom servers during mount via PATHCONF (NFSv3) or the\nFATTR4_CASE_INSENSITIVE/FATTR4_CASE_PRESERVING attributes\n(NFSv4). Expose this information through fileattr_get by\nreporting the FS_XFLAG_CASEFOLD and FS_XFLAG_CASENONPRESERVING\nflags. NFSv2 lacks PATHCONF support, so mounts using that protocol\nversion default to standard POSIX behavior: case-sensitive and\ncase-preserving.\n\nPATHCONF is now invoked unconditionally for NFSv2 and NFSv3 mounts\nso the case-sensitivity capabilities are established even when the\nuser pins server->namelen with the namlen= mount option. That option\nis orthogonal to case handling, and skipping PATHCONF because\nnamelen was already known would leave the caps unset.\n\nThe two capability bits carry opposite polarity because their POSIX\ndefaults differ. Most servers are case-sensitive and case-\npreserving, matching \"neither xflag set.\" NFS_CAP_CASE_INSENSITIVE\nis set only when the server affirms case insensitivity, so \"server\nsaid no\" and \"server did not answer\" both collapse to the case-\nsensitive default. NFS_CAP_CASE_NONPRESERVING follows the same\npattern in the opposite direction: set only when the server affirms\nthat it does not preserve case, so that silence or a missing\nattribute lands on the case-preserving default. The NFSv4 probe\nchecks res.attr_bitmask[0] to distinguish \"server said false\" from\n\"server omitted the attribute\" before setting the bit.\n\nBoth capability bits are cleared at the start of each successful\nprobe so a remount or NFSv4 transparent state migration to a server\nwith different case semantics does not retain stale capabilities\nfrom the prior probe.\n\nReviewed-by: Roland Mainz <roland.mainz@nrubsig.org>\nSigned-off-by: Chuck Lever <chuck.lever@oracle.com>\n---\n fs/nfs/client.c           | 25 ++++++++++++++++++-------\n fs/nfs/inode.c            | 15 +++++++++++++++\n fs/nfs/internal.h         |  3 +++\n fs/nfs/namespace.c        |  2 ++\n fs/nfs/nfs3proc.c         |  2 ++\n fs/nfs/nfs3xdr.c          |  7 +++++--\n fs/nfs/nfs4proc.c         | 10 +++++++---\n fs/nfs/proc.c             |  3 +++\n fs/nfs/symlink.c          |  3 +++\n include/linux/nfs_fs_sb.h |  2 +-\n include/linux/nfs_xdr.h   |  2 ++\n 11 files changed, 61 insertions(+), 13 deletions(-)","diff":"diff --git a/fs/nfs/client.c b/fs/nfs/client.c\nindex be02bb227741..7ca16fc72689 100644\n--- a/fs/nfs/client.c\n+++ b/fs/nfs/client.c\n@@ -914,6 +914,7 @@ static void nfs_server_set_fsinfo(struct nfs_server *server,\n  */\n static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs_fattr *fattr)\n {\n+\tstruct nfs_pathconf pathinfo = { };\n \tstruct nfs_fsinfo fsinfo;\n \tstruct nfs_client *clp = server->nfs_client;\n \tint error;\n@@ -933,15 +934,25 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str\n \n \tnfs_server_set_fsinfo(server, &fsinfo);\n \n-\t/* Get some general file system info */\n-\tif (server->namelen == 0) {\n-\t\tstruct nfs_pathconf pathinfo;\n+\tpathinfo.fattr = fattr;\n+\tnfs_fattr_init(fattr);\n \n-\t\tpathinfo.fattr = fattr;\n-\t\tnfs_fattr_init(fattr);\n-\n-\t\tif (clp->rpc_ops->pathconf(server, mntfh, &pathinfo) >= 0)\n+\tif (clp->rpc_ops->pathconf(server, mntfh, &pathinfo) >= 0) {\n+\t\tif (server->namelen == 0)\n \t\t\tserver->namelen = pathinfo.max_namelen;\n+\t\t/*\n+\t\t * Clear the bits before re-OR'ing so a remount\n+\t\t * against a server with different case semantics\n+\t\t * does not retain stale caps.\n+\t\t */\n+\t\tif (clp->rpc_ops->version < 4) {\n+\t\t\tserver->caps &= ~(NFS_CAP_CASE_INSENSITIVE |\n+\t\t\t\t\t  NFS_CAP_CASE_NONPRESERVING);\n+\t\t\tif (pathinfo.case_insensitive)\n+\t\t\t\tserver->caps |= NFS_CAP_CASE_INSENSITIVE;\n+\t\t\tif (!pathinfo.case_preserving)\n+\t\t\t\tserver->caps |= NFS_CAP_CASE_NONPRESERVING;\n+\t\t}\n \t}\n \n \tif (clp->rpc_ops->discover_trunking != NULL &&\ndiff --git a/fs/nfs/inode.c b/fs/nfs/inode.c\nindex 98a8f0de1199..fdcbe6f2052c 100644\n--- a/fs/nfs/inode.c\n+++ b/fs/nfs/inode.c\n@@ -41,6 +41,7 @@\n #include <linux/freezer.h>\n #include <linux/uaccess.h>\n #include <linux/iversion.h>\n+#include <linux/fileattr.h>\n \n #include \"nfs4_fs.h\"\n #include \"callback.h\"\n@@ -1101,6 +1102,20 @@ int nfs_getattr(struct mnt_idmap *idmap, const struct path *path,\n }\n EXPORT_SYMBOL_GPL(nfs_getattr);\n \n+int nfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)\n+{\n+\tstruct inode *inode = d_inode(dentry);\n+\n+\tif (nfs_server_capable(inode, NFS_CAP_CASE_INSENSITIVE)) {\n+\t\tfa->fsx_xflags |= FS_XFLAG_CASEFOLD;\n+\t\tfa->flags |= FS_CASEFOLD_FL;\n+\t}\n+\tif (nfs_server_capable(inode, NFS_CAP_CASE_NONPRESERVING))\n+\t\tfa->fsx_xflags |= FS_XFLAG_CASENONPRESERVING;\n+\treturn 0;\n+}\n+EXPORT_SYMBOL_GPL(nfs_fileattr_get);\n+\n static void nfs_init_lock_context(struct nfs_lock_context *l_ctx)\n {\n \trefcount_set(&l_ctx->count, 1);\ndiff --git a/fs/nfs/internal.h b/fs/nfs/internal.h\nindex fc5456377160..309d3f679bb3 100644\n--- a/fs/nfs/internal.h\n+++ b/fs/nfs/internal.h\n@@ -449,6 +449,9 @@ extern void nfs_set_cache_invalid(struct inode *inode, unsigned long flags);\n extern bool nfs_check_cache_invalid(struct inode *, unsigned long);\n extern int nfs_wait_bit_killable(struct wait_bit_key *key, int mode);\n \n+struct file_kattr;\n+int nfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);\n+\n #if IS_ENABLED(CONFIG_NFS_LOCALIO)\n /* localio.c */\n struct nfs_local_dio {\ndiff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c\nindex af9be0c5f516..6d0073c24771 100644\n--- a/fs/nfs/namespace.c\n+++ b/fs/nfs/namespace.c\n@@ -246,11 +246,13 @@ nfs_namespace_setattr(struct mnt_idmap *idmap, struct dentry *dentry,\n const struct inode_operations nfs_mountpoint_inode_operations = {\n \t.getattr\t= nfs_getattr,\n \t.setattr\t= nfs_setattr,\n+\t.fileattr_get\t= nfs_fileattr_get,\n };\n \n const struct inode_operations nfs_referral_inode_operations = {\n \t.getattr\t= nfs_namespace_getattr,\n \t.setattr\t= nfs_namespace_setattr,\n+\t.fileattr_get\t= nfs_fileattr_get,\n };\n \n static void nfs_expire_automounts(struct work_struct *work)\ndiff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c\nindex 95d7cd564b74..b80d0c5efc27 100644\n--- a/fs/nfs/nfs3proc.c\n+++ b/fs/nfs/nfs3proc.c\n@@ -1053,6 +1053,7 @@ static const struct inode_operations nfs3_dir_inode_operations = {\n \t.permission\t= nfs_permission,\n \t.getattr\t= nfs_getattr,\n \t.setattr\t= nfs_setattr,\n+\t.fileattr_get\t= nfs_fileattr_get,\n #ifdef CONFIG_NFS_V3_ACL\n \t.listxattr\t= nfs3_listxattr,\n \t.get_inode_acl\t= nfs3_get_acl,\n@@ -1064,6 +1065,7 @@ static const struct inode_operations nfs3_file_inode_operations = {\n \t.permission\t= nfs_permission,\n \t.getattr\t= nfs_getattr,\n \t.setattr\t= nfs_setattr,\n+\t.fileattr_get\t= nfs_fileattr_get,\n #ifdef CONFIG_NFS_V3_ACL\n \t.listxattr\t= nfs3_listxattr,\n \t.get_inode_acl\t= nfs3_get_acl,\ndiff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c\nindex e17d72908412..e745e78faab0 100644\n--- a/fs/nfs/nfs3xdr.c\n+++ b/fs/nfs/nfs3xdr.c\n@@ -2276,8 +2276,11 @@ static int decode_pathconf3resok(struct xdr_stream *xdr,\n \tif (unlikely(!p))\n \t\treturn -EIO;\n \tresult->max_link = be32_to_cpup(p++);\n-\tresult->max_namelen = be32_to_cpup(p);\n-\t/* ignore remaining fields */\n+\tresult->max_namelen = be32_to_cpup(p++);\n+\tp++;\t/* ignore no_trunc */\n+\tp++;\t/* ignore chown_restricted */\n+\tresult->case_insensitive = be32_to_cpup(p++) != 0;\n+\tresult->case_preserving = be32_to_cpup(p) != 0;\n \treturn 0;\n }\n \ndiff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c\nindex d839a97df822..62f66684fbc8 100644\n--- a/fs/nfs/nfs4proc.c\n+++ b/fs/nfs/nfs4proc.c\n@@ -3933,7 +3933,8 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f\n \t\tserver->caps &=\n \t\t\t~(NFS_CAP_ACLS | NFS_CAP_HARDLINKS | NFS_CAP_SYMLINKS |\n \t\t\t  NFS_CAP_SECURITY_LABEL | NFS_CAP_FS_LOCATIONS |\n-\t\t\t  NFS_CAP_OPEN_XOR | NFS_CAP_DELEGTIME);\n+\t\t\t  NFS_CAP_OPEN_XOR | NFS_CAP_DELEGTIME |\n+\t\t\t  NFS_CAP_CASE_INSENSITIVE | NFS_CAP_CASE_NONPRESERVING);\n \t\tserver->fattr_valid = NFS_ATTR_FATTR_V4;\n \t\tif (res.attr_bitmask[0] & FATTR4_WORD0_ACL &&\n \t\t\t\tres.acl_bitmask & ACL4_SUPPORT_ALLOW_ACL)\n@@ -3944,8 +3945,9 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f\n \t\t\tserver->caps |= NFS_CAP_SYMLINKS;\n \t\tif (res.case_insensitive)\n \t\t\tserver->caps |= NFS_CAP_CASE_INSENSITIVE;\n-\t\tif (res.case_preserving)\n-\t\t\tserver->caps |= NFS_CAP_CASE_PRESERVING;\n+\t\tif ((res.attr_bitmask[0] & FATTR4_WORD0_CASE_PRESERVING) &&\n+\t\t    !res.case_preserving)\n+\t\t\tserver->caps |= NFS_CAP_CASE_NONPRESERVING;\n #ifdef CONFIG_NFS_V4_SECURITY_LABEL\n \t\tif (res.attr_bitmask[2] & FATTR4_WORD2_SECURITY_LABEL)\n \t\t\tserver->caps |= NFS_CAP_SECURITY_LABEL;\n@@ -10598,6 +10600,7 @@ static const struct inode_operations nfs4_dir_inode_operations = {\n \t.getattr\t= nfs_getattr,\n \t.setattr\t= nfs_setattr,\n \t.listxattr\t= nfs4_listxattr,\n+\t.fileattr_get\t= nfs_fileattr_get,\n };\n \n static const struct inode_operations nfs4_file_inode_operations = {\n@@ -10605,6 +10608,7 @@ static const struct inode_operations nfs4_file_inode_operations = {\n \t.getattr\t= nfs_getattr,\n \t.setattr\t= nfs_setattr,\n \t.listxattr\t= nfs4_listxattr,\n+\t.fileattr_get\t= nfs_fileattr_get,\n };\n \n static struct nfs_server *nfs4_clone_server(struct nfs_server *source,\ndiff --git a/fs/nfs/proc.c b/fs/nfs/proc.c\nindex 70795684b8e8..03c2c1f31be9 100644\n--- a/fs/nfs/proc.c\n+++ b/fs/nfs/proc.c\n@@ -598,6 +598,7 @@ nfs_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,\n {\n \tinfo->max_link = 0;\n \tinfo->max_namelen = NFS2_MAXNAMLEN;\n+\tinfo->case_preserving = true;\n \treturn 0;\n }\n \n@@ -718,12 +719,14 @@ static const struct inode_operations nfs_dir_inode_operations = {\n \t.permission\t= nfs_permission,\n \t.getattr\t= nfs_getattr,\n \t.setattr\t= nfs_setattr,\n+\t.fileattr_get\t= nfs_fileattr_get,\n };\n \n static const struct inode_operations nfs_file_inode_operations = {\n \t.permission\t= nfs_permission,\n \t.getattr\t= nfs_getattr,\n \t.setattr\t= nfs_setattr,\n+\t.fileattr_get\t= nfs_fileattr_get,\n };\n \n const struct nfs_rpc_ops nfs_v2_clientops = {\ndiff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c\nindex 58146e935402..74a072896f8d 100644\n--- a/fs/nfs/symlink.c\n+++ b/fs/nfs/symlink.c\n@@ -22,6 +22,8 @@\n #include <linux/mm.h>\n #include <linux/string.h>\n \n+#include \"internal.h\"\n+\n /* Symlink caching in the page cache is even more simplistic\n  * and straight-forward than readdir caching.\n  */\n@@ -74,4 +76,5 @@ const struct inode_operations nfs_symlink_inode_operations = {\n \t.get_link\t= nfs_get_link,\n \t.getattr\t= nfs_getattr,\n \t.setattr\t= nfs_setattr,\n+\t.fileattr_get\t= nfs_fileattr_get,\n };\ndiff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h\nindex 4daee27fa5eb..34d294774f8c 100644\n--- a/include/linux/nfs_fs_sb.h\n+++ b/include/linux/nfs_fs_sb.h\n@@ -306,7 +306,7 @@ struct nfs_server {\n #define NFS_CAP_ATOMIC_OPEN\t(1U << 4)\n #define NFS_CAP_LGOPEN\t\t(1U << 5)\n #define NFS_CAP_CASE_INSENSITIVE\t(1U << 6)\n-#define NFS_CAP_CASE_PRESERVING\t(1U << 7)\n+#define NFS_CAP_CASE_NONPRESERVING\t(1U << 7)\n #define NFS_CAP_REBOOT_LAYOUTRETURN\t(1U << 8)\n #define NFS_CAP_OFFLOAD_STATUS\t(1U << 9)\n #define NFS_CAP_ZERO_RANGE\t(1U << 10)\ndiff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h\nindex ff1f12aa73d2..7c2057e40f99 100644\n--- a/include/linux/nfs_xdr.h\n+++ b/include/linux/nfs_xdr.h\n@@ -182,6 +182,8 @@ struct nfs_pathconf {\n \tstruct nfs_fattr\t*fattr; /* Post-op attributes */\n \t__u32\t\t\tmax_link; /* max # of hard links */\n \t__u32\t\t\tmax_namelen; /* max name length */\n+\tbool\t\t\tcase_insensitive;\n+\tbool\t\t\tcase_preserving;\n };\n \n struct nfs4_change_info {\n","prefixes":["v12","10/15"]}