🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

vnode locks vs write backs in the NFS client

#251
From: Rick Macklem
Date: Sun, 29 Nov 2026 16:57
48 lines
7152 bytes
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?

rick


--
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: <CAM5tNy77rPMX6bbON5VAavnxJt6fLn-vFXrpyp28v3hS4v+xOg@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!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: Rick Macklem <rick.macklem@gmail.com>
Newsgroups: muc.lists.freebsd.current
Subject: vnode locks vs write backs in the NFS client
Date: Sun, 29 Nov 2026 09:57:57 -0700
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <CAM5tNy77rPMX6bbON5VAavnxJt6fLn-vFXrpyp28v3hS4v+xOg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="34979"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795971518;
	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:
	 list-id:list-help:list-owner:list-unsubscribe:list-subscribe:  list-post;
	bh=NRXjFceFrQPcKxC8wnQSnRYFNhA/ucEFAVS92Vit1Yk=;
	b=HbWbxR6oUuTmI0QowGPZq7MzRJ3ozypeglT5wqG6JYjV1JCUIJ63gsy2SZyxNWcZqXn6nb
	bGanyYD8QsHyAMMtYLIe16LpDQr/RBB81IpgnLk/wdW/ylwQq43OeQ6N3t53cUS1WV1x2M
	rQzGDZQxhw1bgCv655YwK3OlzVGlV7OUiMVAgMP+52uMlcjvgUVQEncIhfZEUMY5zqtSNc
	cPtZX/k1Tqxo7MI2SPSgCKwefH3VgPuH+38Zrt+0cBrBW2n57x+DQDI8xEQ3cPZh6zSTmS
	A0yv9FJ2vARIEPt9JIyRdLQAf6GW5GC5IvnGWQNqudo6uH6eLfhnCdGsAMKJBg==
X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=gmail.com header.s=20260707 header.b=WQD68Rcd;
	spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::535 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com;
	dmarc=pass (policy=none) header.from=gmail.com;
	arc=pass ("google.com:s=arc-20260327:i=1")
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795971489; x=1796576289; darn=freebsd.org;
        h=content-type:cc:to:subject:message-id:date:from:mime-version:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=NRXjFceFrQPcKxC8wnQSnRYFNhA/ucEFAVS92Vit1Yk=;
        b=WQD68RcdciGddjDh/+rHkteT0xBFqe8Y2lUQda2wT+1s86IAF5rm/canYP442jVZAW
         OpHc6pzESH+WrxTsagLqq9x/gHSag/zdiI0cOT9lPh8/BVEC5H7SAbGNdEuReCIzJR11
         7asp69tSquvbzaDFf8K4LHuolHUFRgtcyouhHyzT2VLx1/B5Ko2xDVa3pJO/rGGPfMBy
         fi+vK/EbvcPC/R1rhhm1ygXxUyji+4HyDjWnOav0fesM60GX4KlucAatMmM4l+NW/JyZ
         UIMwfQKPwGpP+VB5IMLnWuOQjvUU4NYQOMlOMbz6CnA4jRnhp3BWjQkCmyK7kbPCMJM4
         s4Dw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795971489; x=1796576289;
        h=content-type:cc:to:subject:message-id:date:from:mime-version
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=NRXjFceFrQPcKxC8wnQSnRYFNhA/ucEFAVS92Vit1Yk=;
        b=dAwhTuu1mMchkHqw2Hxg7dV06h/t8que0RrLp4bz2GkK52AHpkd8vTjQBO0W+T8RyH
         8m/fJ2rTeJcbmH/BD6wdMJf2iMZp6WDfsoJlQZh5ekG8IlmAUj7nVVoripEE/FJgGYI3
         6oMEx0s6b262Ci0ms9Ba6LYwpByet0oFi+IjaCjybAIGvh1zgutXk6kYHXwBRrCapgv+
         FpM78kU6n85Tu8+E8pB/h0svP/SAunAsofPt76ckY24JH3VU/uQw7QQhirh49iaWZn5S
         oRXV1GOTfgtFoMu8tRFv7G8564Wi5ta833YuA6ltBtVIjztDElBZrEK/5gIFKbYTUx+C
         M+qw==
X-Forwarded-Encrypted: i=1; AL+hErGXZEvfNxXc8uKQaZHb49/UQytlqMPU0zF5d6Olp8Ck+DjEyrv0W9m/rrx92moUHtpM/u6P1JndV3hO7jNZbco=@freebsd.org
X-Gm-Message-State: APuU4Z/jEWZ6vPlHcyzMSyZoSD54a/7Cn5/lr/sJgmFMyJTy4QlTfjI6
	b8jvWEMBYjgWwwioVngT5XM4Aqu6HUS0nY6xar8RBCnPUl27Bv5opQo5MocuTSxjuv5/zDfOg70
	0mtEDxX07pytqVkvIRpi18B9cLwf9WA==
X-Gm-Gg: AZFdTZeEYnvHo4GFuoAephqz6kM8RKRtX47JB16vL0tuQWCA83ywcaVBzwmE+2IpARj
	bFT7IU0rruyk0mWk3DRWpEB3UYCAnX8AesKCy5Mho4f9bvLlrogA8aw44RsuUxTatSBg2N9Dwlh
	uom3UDVWYamJB6JmLE2eDjAbfnccwsfWzU/RgMHYKcRqtzMUaqgII8gSMhaLMIs9sT00JtUHD+5
	mBeg8+BlTHXU0lpqDa/0uzCGFGizTlZGo00/adqfk5AytHohqaHOFCiH7NgeKXryHKgQXLdYais
	X+idzlBUUSdXtUh5pBhCtAsH18Trk6Qkb8yz1nDzOYwkF2aPAjM+BknQiBl9vv+gMB9PIeWv3Do
	WSUWGn1ZXM0tf/0lKgSicBt5sEb4ZLTXuCgZ9ZyEfCeTjzPjygHySUCE8UoTFrsoqms3Qyg==
Precedence: list
X-Gm-Features: Aa3M54rHykILeO9tTLUcG-VReyPZWoGBbOH51r2lGbnyouy-RbC76VZ0xaCIhPE
X-Rspamd-Queue-Id: 4jctdJ2PJpz4Mxj
X-Spamd-Bar: --
X-Spamd-Result: default: False [-2.00 / 15.00];
	ARC_ALLOW(-1.00)[google.com:s=arc-20260327:i=1];
	DMARC_POLICY_ALLOW(-0.50)[gmail.com,none];
	R_DKIM_ALLOW(-0.20)[gmail.com:s=20260707];
	R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4864::/56];
	MIME_GOOD(-0.10)[text/plain];
	ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US];
	RCVD_COUNT_ONE(0.00)[1];
	MISSING_XM_UA(0.00)[];
	RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::535:from];
	MIME_TRACE(0.00)[0:+];
	DWL_DNSWL_NONE(0.00)[gmail.com:dkim];
	FREEMAIL_FROM(0.00)[gmail.com];
	MID_RHS_MATCH_FROMTLD(0.00)[];
	RCVD_TLS_LAST(0.00)[];
	MLMMJ_DEST(0.00)[freebsd-current@freebsd.org];
	FROM_EQ_ENVFROM(0.00)[];
	FREEMAIL_ENVFROM(0.00)[gmail.com];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_THREE(0.00)[4];
	TO_MATCH_ENVRCPT_SOME(0.00)[];
	TO_DN_ALL(0.00)[];
	PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org];
	ALIAS_RESOLVED(0.00)[];
	DKIM_TRACE(0.00)[gmail.com:+]
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes