From nobody Sat Jan 17 00:12:27 2026 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dtHGw0QZZz6P5Hl for ; Sat, 17 Jan 2026 00:12:40 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4dtHGv2zhLz45r2 for ; Sat, 17 Jan 2026 00:12:39 +0000 (UTC) (envelope-from kib@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=freebsd.org (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kib@freebsd.org) smtp.mailfrom=kib@freebsd.org Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 60H0CRLi004869; Sat, 17 Jan 2026 02:12:30 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 60H0CRLi004869 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 60H0CRci004868; Sat, 17 Jan 2026 02:12:27 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sat, 17 Jan 2026 02:12:27 +0200 From: Konstantin Belousov To: Rick Macklem Cc: Cedric Blancher , freebsd-hackers@freebsd.org Subject: Re: FreeBSD NFSv4.1 *CLIENT* - case insensitive filesystems supported? Re: FreeBSD NFSv4.1 client and server - case insensitive filesystems supported? Message-ID: References: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home X-Spamd-Bar: / X-Spamd-Result: default: False [-0.42 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989]; NEURAL_HAM_MEDIUM(-0.93)[-0.933]; NEURAL_SPAM_LONG(0.51)[0.507]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; FREEFALL_USER(0.00)[kib]; TAGGED_RCPT(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; R_DKIM_NA(0.00)[]; MISSING_XM_UA(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; FROM_EQ_ENVFROM(0.00)[]; HAS_XAW(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_THREE(0.00)[3] X-Rspamd-Queue-Id: 4dtHGv2zhLz45r2 On Fri, Jan 16, 2026 at 04:05:04PM -0800, Rick Macklem wrote: > On Fri, Jan 16, 2026 at 3:47 PM Konstantin Belousov wrote: > > > > On Fri, Jan 16, 2026 at 03:24:38PM -0800, Rick Macklem wrote: > > > On Fri, Jan 16, 2026 at 6:18 AM Konstantin Belousov wrote: > > > > > > > > On Fri, Jan 16, 2026 at 05:53:56AM -0800, Rick Macklem wrote: > > > > > On Thu, Jan 15, 2026 at 11:55 PM Cedric Blancher > > > > > wrote: > > > > > > > > > > > > On Mon, 12 Jan 2026 at 23:04, Rick Macklem wrote: > > > > > > > > > > > > > > On Mon, Jan 12, 2026 at 1:56 PM Rick Macklem wrote: > > > > > > > > > > > > > > > > On Mon, Jan 12, 2026 at 11:52 AM Cedric Blancher > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > Good evening! > > > > > > > > > > > > > > > > > > Does the FreeBSD >= 14.3 NFSv4.1 client and server support case > > > > > > > > > insensitive filesystems, e.g. exported ZFS or FAT? > > > > > > > > Greater than, as in 15.0. > > > > > > > Oops, that's 15.1-> > > > > > > > (I looked and it is in stable/15, but not releng/15.0.) > > > > > > > (I work with main and the stable branches and don't keep track of when the > > > > > > > releases branch off.) > > > > > > > > > > > > What about the FreeBSD 15.x NFSv4.2 client - does it support > > > > > > case-insensitive filesystems? > > > > > I suppose. It doesn't care. If an application cares (I don't know of > > > > > one, offhand), it can check via pathconf(2) to see if the fs is > > > > > case-insensitive (the _PC_CASE_INSENSITIVE pathconf name > > > > > was added recently and will be in 15.1). > > > > > > > > If the client uses namecache, then I suppose it cares, esp. about caching > > > > the negative lookups. Also for renames and deletes, the whole set of > > > > cached entries for the directory must be expunged. > > > Good point. I did have looking at this on my "to do" list, but forgot > > > about it. So, I suppose that the current answer is "the NFS client > > > does not handle case-insensitive file names correctly" until handling > > > of negative name caching is fixed. > > > > > > Initially, I might just disable name caching for case-insensitive file > > > systems. > > > > > > It sounds like the name caching code should have an option for > > > case-insensitive name comparison? > > > (For plain ASCII, that should be straightforward, but for non-ASCII > > > character sets?? I am not conversant with how case insensitivity is > > > handled for non-ASCII character sets. I know that ZFS has some > > > "form" options, but that's all I know?) > > > > Msdosfs is case-insensitive by MS requirements. It also has some > > complications due to long names translations to the 8.3 FAT16 format. > > > > Due to this, msdosfs does not cache -ve entries at all. This, together > > with cache purge for the directory on rename or remove, should be enough. > > Of course, this assumes that lookup would match a dirent entry right > > WRT the case. > > > > I do not know exactly how the non-ASCII codepoints are handled by our > > msdosfs, but I am sure that we do not have unicode tables for convertion > > between cases. In other words, we most likely do not handle them well. > > > > Does nfs client know if the server is case-insensitive? > Yes, for main (and 15.1 when it gets released). > So, I have a little while to fix it. > msdosfs and ZFS are patched to return 1 for pathconf() > for _PC_CASE_INSENSITIVE and the NFS client now > gets this info. (It only gets a boolean indicating if the > server file system is case-insensitive. It does not get any > other info like what ZFS has, below.) > > ZFS appears to completely disable name caching when the > file system has normalization set to other than none (if I read > the code correctly?). > >From "man zfsprops".. > normalization=none|formC|formD|formKC|formKD > (I have no idea what these mean, but I am guessing that there > is code in ZFS for these. Of course, it will CDDL'd, so it cannot > be included in the base system.) > > > Then it could > > act similarly to our msdosfs. But again, I do not think that msdosfs > > informs nfs server that it is case-insensitive. > Yes, I think this would be sufficient for now. > (I was thinking of putting a nfs_XXX() front end for the cache_XXX() > calls. It could map names to "all lower case" for the case insensitive > case, but that only works for plain ASCII. > If there was a mount option that completely disables name caching > instead of mapping to "all lower case", that would cover the non-ASCII > case, I think?) Disabling caching at all would work, but would probably also be quite inefficient. I implemented nonc option for tmpfs, you might grep for rm_nonc in fs/tmpfs to see how the plumbing works. > --> Does this sound like a reasonable plan? rick > > >