🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.current
Article #252

Re: vnode locks vs write backs in the NFS client

#252
From: Konstantin Belousov
Date: Sun, 29 Nov 2026 17:27
51 lines
5165 bytes
On Sun, Nov 29, 2026 at 09:57:57AM -0700, Rick Macklem wrote:
> Hi,
> 
> During testing of the RDMA code being done by the NVidia folk,
> they got a panic caused by VOP_STRATEGY() being called with
> an unlocked vnode.
> 
> They had delegations enabled (and were accessing the same
> file from multiple mounts) along with WITNESS and INVARIANTS.
> 
> The panic is not surprising, since the nfscl thread tries to do
> write backs without the vnode lock. This is not so much a bug
> as a faeture, since the NFS client has done write backs with
> the buffer lock held, but no vnode lock, since the code was
> written decades ago. (Note that LK_EXCLOTHER is a NFS
> related "hack", but vop_asser_locked() does not consider
> that case as locked.)
> 
> I'm guessing people haven't been reporting this for..
> - Running production kernels without DEBUG_VFS_LOCKS,
>   INVARIANTS, WITNESS.
> - Not enabling delegations (for this case).
> 
> I do believe that the current code is safe, in the sense that
> the buffer lock is sufficient to maintain consistency during
> write backs to the NFS server. (A "umount -N" handles this
> stuff ok. Not sure about "umount -f", but "umount -f' is mostly
> useless for the NFS client, anyhow.)
> 
> So, what can we do??
> 
> I think the best approach might be to convert the NFS client to
> using shared vnode locks for writing (like ZFS currently
> does).  That way, the NFS client can acquire the shared
> vnode lock for write-backs when other threads have the
> vnode shared locked for writing.
> --> However, this could take a while to implement.
> 
> In the meantime, I think we just accept that debug kernels
> won't work correctly, at least when delegations are enabled.
> 
> Other ideas?

Or add VOP_STRATEGY_UNLOCKED(), changing all implementations in fses to
provide VOP_STRATEGY_UNLOCKED().  VOP_STRATEGY() would simply redirect
to VOP_STRATEGY_UNLOCKED().


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <awxgnk2qkUeej3aI@kib.kiev.ua>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
References: <CAM5tNy77rPMX6bbON5VAavnxJt6fLn-vFXrpyp28v3hS4v+xOg@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: Konstantin Belousov <kib@freebsd.org>
Newsgroups: muc.lists.freebsd.current
Subject: Re: vnode locks vs write backs in the NFS client
Date: Sun, 29 Nov 2026 19:27:58 +0200
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <awxgnk2qkUeej3aI@kib.kiev.ua>
References: <CAM5tNy77rPMX6bbON5VAavnxJt6fLn-vFXrpyp28v3hS4v+xOg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="56800"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795973314;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:list-id:list-help:
	 list-owner:list-unsubscribe:list-subscribe:list-post;
	bh=Mlln5DWCKJER99x7ToDF148TPVsL6HV9Ihl97nXZ3cA=;
	b=wg+VEG/O+hZRfEnx7zYp6HSz0WOALZOIjFZw/kQx03VT5Bc13F6ZrO7juJdfGdUwQPQj7g
	MUsIpQJM5iXzO9lhIzHPraiR+rxgAn1owAL8+M4CnZuSYY3TM8/UJX++mhBLgoptgItM1Y
	xVNlZY11dW+w9M79uEug8TT5OTSrV22wcZ4Pr/7HrRtniGkXPCRn2D4DLZ33xvCwT3CS8I
	x42teFt1u7Fy1+OXApf+tcMHeS/CBYqg/ILGtbZMPsVea1L6SGfz0l2sf6nXYLQt+xy7qP
	KwsEnxUQ0GONnvm3gswbPHdITNj0LewXMfi+Hxs0Pwr3HECZ3WJorhDkGJrV8A==
X-Original-To: freebsd-current@mlmmj.nyi.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
DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 6ATHRwWF004980
X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f
Precedence: list
Content-Disposition: inline
In-Reply-To: <CAM5tNy77rPMX6bbON5VAavnxJt6fLn-vFXrpyp28v3hS4v+xOg@mail.gmail.com>
X-Rspamd-Queue-Id: 4jcvHv5Z8qz4Qd5
X-Spamd-Bar: /
X-Spamd-Result: default: False [0.00 / 15.00];
	MIME_GOOD(-0.10)[text/plain];
	DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, No valid DKIM,none];
	FREEMAIL_TO(0.00)[gmail.com];
	R_DKIM_NA(0.00)[];
	HAS_XAW(0.00)[];
	RCVD_TLS_LAST(0.00)[];
	ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FREEFALL_USER(0.00)[kib];
	MLMMJ_DEST(0.00)[freebsd-current@freebsd.org];
	ALIAS_RESOLVED(0.00)[];
	TO_DN_ALL(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	MISSING_XM_UA(0.00)[];
	R_SPF_SOFTFAIL(0.00)[~all:c];
	DNSWL_BLOCKED(0.00)[2001:470:d5e7:1::1:from];
	TO_MATCH_ENVRCPT_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	RCPT_COUNT_THREE(0.00)[4]
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes