NetBSD Problem Report #59452

From www@netbsd.org  Sun Jun  1 10:51:43 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EDC1E1A923C
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  1 Jun 2025 10:51:42 +0000 (UTC)
Message-Id: <20250601105141.499DE1A923E@mollari.NetBSD.org>
Date: Sun,  1 Jun 2025 10:51:41 +0000 (UTC)
From: drixter@e-utp.net
Reply-To: drixter@e-utp.net
To: gnats-bugs@NetBSD.org
Subject: Move NFS wcc data messages to debug or control them via sysctl.
X-Send-Pr-Version: www-1.0

>Number:         59452
>Category:       kern
>Synopsis:       Move NFS wcc data messages to debug or control them via sysctl.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 01 10:55:00 +0000 2025
>Last-Modified:  Wed Oct 22 19:10:01 +0000 2025
>Originator:     Marcin Gondek
>Release:        NetBSD current
>Organization:
e-utp.net
>Environment:
NetBSD devil.e-utp.net 10.99.14 NetBSD 10.99.14 (DEVIL) #43: Wed May 21 21:43:55 CEST 2025  root@devil.e-utp.net:/usr/obj/sys/arch/amd64/compile/DEVIL amd64

>Description:
Hi.

I know that such messages should not generally appear if the NFS server is working properly. But unfortunately it is not repairable everywhere -> Synology NFS, hence the question about the possibility of moving these messages to the DEBUG variant or maybe make it controlable via sysctl.

[    54.639309] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1747860168.846777829 1747860168.846777829, mtime 1747860168.846777829 1747860168.846777829)
[  8290.061715] diskstation6.e-utp.net:/volume1/Applications/html: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1747868404.268648787 1747868404.268648787, mtime 1747868404.268648787 1747868404.268648787)
[ 37999.556765] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1747898113.761877738 1747898113.761877738, mtime 1747898113.761877738 1747898113.761877738)
[ 129985.269256] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1747990099.474778485 1747990099.474778485, mtime 1747990099.474778485 1747990099.474778485)
[ 271086.518951] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-enabling wcc
[ 346441.968607] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1748206556.173615162 1748206556.173615162, mtime 1748206556.173615162 1748206556.172615149)
[ 514378.384585] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-enabling wcc
[ 514557.066122] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1748374671.270579777 1748374671.270579777, mtime 1748374671.270579777 1748374671.270579777)
[ 515971.888284] diskstation6.e-utp.net:/volume1/homes/drixter: re-enabling wcc
[ 515971.888284] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1748376086.092195755 1748376086.092195755, mtime 1748376086.092195755 1748376086.092195755)
[ 660108.808665] diskstation6.e-utp.net:/volume1/homes/drixter: re-enabling wcc
[ 660108.958666] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1748520223.159904837 1748520223.159904837, mtime 1748520223.159904837 1748520223.159904837)
[ 850685.043667] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-enabling wcc
[ 850838.054987] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1748710952.261138867 1748710952.261138867, mtime 1748710952.261138867 1748710952.261138867)
[ 851717.862621] diskstation6.e-utp.net:/volume1/homes/drixter: re-enabling wcc
[ 851717.942624] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1748711832.146387487 1748711832.146387487, mtime 1748711832.146387487 1748711832.146387487)

>How-To-Repeat:
Make some load on NFS share.
>Fix:
Probably define DEBUG option for printf.

The patch is not tested, just to idea how this can be covered, if possible.

As far now I have no clue how to handle it via sysctl option.

==cut==
*** nfs_clntsubs.c      Sun Jun  1 12:41:04 2025
--- nfs_clntsubs-IFDEF.c        Sun Jun  1 12:43:24 2025
***************
*** 424,429 ****
--- 424,430 ----

                        mutex_enter(&nmp->nm_lock);
                        if (!NFS_WCCKLUDGE(nmp, now)) {
+ #ifdef DEBUG
                                printf("%s: inaccurate wcc data (%s) detected,"
                                    " disabling wcc"
                                    " (ctime %u.%09u %u.%09u,"
***************
*** 438,443 ****
--- 439,445 ----
                                    (unsigned int)omtime->tv_nsec,
                                    (unsigned int)mtime->tv_sec,
                                    (unsigned int)mtime->tv_nsec);
+ #endif
                        }
                        nmp->nm_iflag |= NFSMNT_WCCKLUDGE;
                        nmp->nm_wcckludgetime = now;
***************
*** 447,454 ****
--- 449,458 ----
                } else if (nmp->nm_iflag & NFSMNT_WCCKLUDGE) {
                        mutex_enter(&nmp->nm_lock);
                        if (nmp->nm_iflag & NFSMNT_WCCKLUDGE) {
+ #ifdef DEBUG
                                printf("%s: re-enabling wcc\n",
                                    vp->v_mount->mnt_stat.f_mntfromname);
+ #endif
                                nmp->nm_iflag &= ~NFSMNT_WCCKLUDGE;
                        }
                        mutex_exit(&nmp->nm_lock);
==cut==

Thanks,

>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/59452: Move NFS wcc data messages to debug or control them via sysctl.
Date: Sun, 1 Jun 2025 11:41:06 -0000 (UTC)

 drixter@e-utp.net writes:

 >I know that such messages should not generally appear if the NFS server is working properly. But unfortunately it is not repairable everywhere -> Synology NFS, hence the question about the possibility of moving these messages to the DEBUG variant or maybe make it controlable via sysctl.

 >[ 514378.384585] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-enabling wcc
 >[ 514557.066122] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccurate wcc data (ctime) detected, disabling wcc (ctime 1748374671.270579777 1748374671.270579777, mtime 1748374671.270579777 1748374671.270579777)

 Most of the messages appear to be "re-enabling" + "disabling wcc" again within a few seconds.

 What happens when you just disable the attribute cache when mounting with 'mount -o noac' ? It's hardly used anyway.

From: Marcin Gondek <drixter@e-utp.net>
To: "gnats-bugs@netbsd.org" <gnats-bugs@netbsd.org>,
	"kern-bug-people@netbsd.org" <kern-bug-people@netbsd.org>,
	"gnats-admin@netbsd.org" <gnats-admin@netbsd.org>, "netbsd-bugs@netbsd.org"
	<netbsd-bugs@netbsd.org>
Cc: 
Subject: RE: kern/59452: Move NFS wcc data messages to debug or control them
 via sysctl.
Date: Sun, 1 Jun 2025 12:06:38 +0000

 Hi Michael

 I've setup now as you suggested, It's the same, box restarted to be sure:

 [   190.659022] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate w=
 cc data (ctime) detected, disabling wcc (ctime 1748779290.941608597 1748779=
 290.941608597, mtime 1748779290.941608597 1748779290.941608597)

 devil# mount -vv | grep drixter | grep noac
 diskstation6.e-utp.net:/volume1/homes/drixter on /home/users/drixter type n=
 fs (automounted, fsid: 0xb0e/0x70b, reads: sync 0 async 0, writes: sync 0 a=
 sync 0, [nfs: addr=3D2001:67c:21ec:ffee:18f2:a77c:dc08:aef6, port=3D2049, a=
 ddrlen=3D28, sotype=3D1, proto=3D0, fhsize=3D0, flags=3D0x88247<soft,wsize,=
 rsize,intr,nfsv3,resvport,noac>, wsize=3D8192, rsize=3D8192, readdirsize=3D=
 4096, timeo=3D300, retrans=3D10, maxgrouplist=3D16, readahead=3D2, leaseter=
 m=3D0, deadthresh=3D9])
 devil#

 devil# cat /etc/auto_homes
 * -rw,noac,soft,intr,rsize=3D8192,wsize=3D8192 diskstation6.e-utp.net:/volu=
 me1/homes/&

 noac is included.


 Thanks,

 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: netbsd-bugs-owner@NetBSD.org <netbsd-bugs-owner@NetBSD.org> On Behalf=
  Of Michael van Elst via gnats
 Sent: Sunday, June 1, 2025 1:45 PM
 To: kern-bug-people@netbsd.org; gnats-admin@netbsd.org; netbsd-bugs@netbsd.=
 org; Marcin Gondek <drixter@e-utp.net>
 Subject: Re: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 The following reply was made to PR kern/59452; it has been noted by GNATS.

 From: mlelstv@serpens.de (Michael van Elst)
 To: gnats-bugs@netbsd.org
 Cc:=20
 Subject: Re: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.
 Date: Sun, 1 Jun 2025 11:41:06 -0000 (UTC)

  drixter@e-utp.net writes:
 =20
  >I know that such messages should not generally appear if the NFS server i=
 s working properly. But unfortunately it is not repairable everywhere -> Sy=
 nology NFS, hence the question about the possibility of moving these messag=
 es to the DEBUG variant or maybe make it controlable via sysctl.
 =20
  >[ 514378.384585] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-=
 enabling wcc  >[ 514557.066122] diskstation6.e-utp.net:/volume1/Application=
 s/NetBSD: inaccurate wcc data (ctime) detected, disabling wcc (ctime 174837=
 4671.270579777 1748374671.270579777, mtime 1748374671.270579777 1748374671.=
 270579777)
 =20
  Most of the messages appear to be "re-enabling" + "disabling wcc" again wi=
 thin a few seconds.
 =20
  What happens when you just disable the attribute cache when mounting with =
 'mount -o noac' ? It's hardly used anyway.
 =20

From: Marcin Gondek <drixter@e-utp.net>
To: Marcin Gondek <drixter@e-utp.net>, "gnats-bugs@netbsd.org"
	<gnats-bugs@netbsd.org>, "kern-bug-people@netbsd.org"
	<kern-bug-people@netbsd.org>, "gnats-admin@netbsd.org"
	<gnats-admin@netbsd.org>, "netbsd-bugs@netbsd.org" <netbsd-bugs@netbsd.org>
Cc: 
Subject: RE: kern/59452: Move NFS wcc data messages to debug or control them
 via sysctl.
Date: Mon, 9 Jun 2025 10:48:13 +0000

 Hi.

 [   190.659022] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate w=
 cc data (ctime) detected, disabling wcc (ctime 1748779290.941608597 1748779=
 290.941608597, mtime 1748779290.941608597 1748779290.941608597)
 [ 14577.965578] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccu=
 rate wcc data (ctime) detected, disabling wcc (ctime 1748793678.251985388 1=
 748793678.251985388, mtime 1748793678.251985388 1748793678.251985388)
 [ 39826.666864] diskstation6.e-utp.net:/volume1/Applications/html: inaccura=
 te wcc data (ctime) detected, disabling wcc (ctime 1748818926.951985610 174=
 8818926.951985610, mtime 1748818926.951985610 1748818926.951985610)
 [ 103278.442441] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-en=
 abling wcc
 [ 104091.099550] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inacc=
 urate wcc data (ctime) detected, disabling wcc (ctime 1748883191.385396294 =
 1748883191.385396294, mtime 1748883191.385396294 1748883191.385396294)
 [ 112832.426073] diskstation6.e-utp.net:/volume1/homes/drixter: re-enabling=
  wcc
 [ 112853.086255] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate =
 wcc data (ctime) detected, disabling wcc (ctime 1748891953.379970261 174889=
 1953.379970261, mtime 1748891953.379970261 1748891953.379970261)
 [ 530900.589197] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-en=
 abling wcc
 [ 530982.569922] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inacc=
 urate wcc data (ctime) detected, disabling wcc (ctime 1749310082.858985530 =
 1749310082.858985530, mtime 1749310082.858985530 1749310082.858985530)

 The logs messages in kernel, still appears, even with noac option, the side=
 -effect is that NFS is quite slow right now when processing multiple small =
 files.
 I suggest maybe to move forward with my idea to control it via DEBUG and./o=
 r sysctl variable if possible.

 Thanks,

 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: netbsd-bugs-owner@NetBSD.org <netbsd-bugs-owner@NetBSD.org> On Behalf=
  Of Marcin Gondek
 Sent: Sunday, June 1, 2025 2:07 PM
 To: gnats-bugs@netbsd.org; kern-bug-people@netbsd.org; gnats-admin@netbsd.o=
 rg; netbsd-bugs@netbsd.org
 Subject: RE: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 Hi Michael

 I've setup now as you suggested, It's the same, box restarted to be sure:

 [   190.659022] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate w=
 cc data (ctime) detected, disabling wcc (ctime 1748779290.941608597 1748779=
 290.941608597, mtime 1748779290.941608597 1748779290.941608597)

 devil# mount -vv | grep drixter | grep noac diskstation6.e-utp.net:/volume1=
 /homes/drixter on /home/users/drixter type nfs (automounted, fsid: 0xb0e/0x=
 70b, reads: sync 0 async 0, writes: sync 0 async 0, [nfs: addr=3D2001:67c:2=
 1ec:ffee:18f2:a77c:dc08:aef6, port=3D2049, addrlen=3D28, sotype=3D1, proto=
 =3D0, fhsize=3D0, flags=3D0x88247<soft,wsize,rsize,intr,nfsv3,resvport,noac=
 >, wsize=3D8192, rsize=3D8192, readdirsize=3D4096, timeo=3D300, retrans=3D1=
 0, maxgrouplist=3D16, readahead=3D2, leaseterm=3D0, deadthresh=3D9]) devil#

 devil# cat /etc/auto_homes
 * -rw,noac,soft,intr,rsize=3D8192,wsize=3D8192 diskstation6.e-utp.net:/volu=
 me1/homes/&

 noac is included.


 Thanks,

 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: netbsd-bugs-owner@NetBSD.org <netbsd-bugs-owner@NetBSD.org> On Behalf=
  Of Michael van Elst via gnats
 Sent: Sunday, June 1, 2025 1:45 PM
 To: kern-bug-people@netbsd.org; gnats-admin@netbsd.org; netbsd-bugs@netbsd.=
 org; Marcin Gondek <drixter@e-utp.net>
 Subject: Re: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 The following reply was made to PR kern/59452; it has been noted by GNATS.

 From: mlelstv@serpens.de (Michael van Elst)
 To: gnats-bugs@netbsd.org
 Cc:=20
 Subject: Re: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.
 Date: Sun, 1 Jun 2025 11:41:06 -0000 (UTC)

  drixter@e-utp.net writes:
 =20
  >I know that such messages should not generally appear if the NFS server i=
 s working properly. But unfortunately it is not repairable everywhere -> Sy=
 nology NFS, hence the question about the possibility of moving these messag=
 es to the DEBUG variant or maybe make it controlable via sysctl.
 =20
  >[ 514378.384585] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-=
 enabling wcc  >[ 514557.066122] diskstation6.e-utp.net:/volume1/Application=
 s/NetBSD: inaccurate wcc data (ctime) detected, disabling wcc (ctime 174837=
 4671.270579777 1748374671.270579777, mtime 1748374671.270579777 1748374671.=
 270579777)
 =20
  Most of the messages appear to be "re-enabling" + "disabling wcc" again wi=
 thin a few seconds.
 =20
  What happens when you just disable the attribute cache when mounting with =
 'mount -o noac' ? It's hardly used anyway.
 =20

From: Marcin Gondek <drixter@e-utp.net>
To: "gnats-bugs@netbsd.org" <gnats-bugs@netbsd.org>,
	"kern-bug-people@netbsd.org" <kern-bug-people@netbsd.org>,
	"gnats-admin@netbsd.org" <gnats-admin@netbsd.org>, "netbsd-bugs@netbsd.org"
	<netbsd-bugs@netbsd.org>
Cc: 
Subject: RE: kern/59452: Move NFS wcc data messages to debug or control them
 via sysctl.
Date: Thu, 24 Jul 2025 08:16:47 +0000

 Hi All,

 Is there any chance that someone will change it?
 I know that is rare case, but for my boxes I'm getting spam in dmesg on eve=
 ry high load ;-/
 With noac option there is a less spam but performance is significantly degr=
 aded.

 Thanks,


 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: Marcin Gondek=20
 Sent: Monday, June 9, 2025 12:48 PM
 To: Marcin Gondek <drixter@e-utp.net>; gnats-bugs@netbsd.org; kern-bug-peop=
 le@netbsd.org; gnats-admin@netbsd.org; netbsd-bugs@netbsd.org
 Subject: RE: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 Hi.

 [   190.659022] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate w=
 cc data (ctime) detected, disabling wcc (ctime 1748779290.941608597 1748779=
 290.941608597, mtime 1748779290.941608597 1748779290.941608597)
 [ 14577.965578] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccu=
 rate wcc data (ctime) detected, disabling wcc (ctime 1748793678.251985388 1=
 748793678.251985388, mtime 1748793678.251985388 1748793678.251985388) [ 398=
 26.666864] diskstation6.e-utp.net:/volume1/Applications/html: inaccurate wc=
 c data (ctime) detected, disabling wcc (ctime 1748818926.951985610 17488189=
 26.951985610, mtime 1748818926.951985610 1748818926.951985610) [ 103278.442=
 441] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-enabling wcc [=
  104091.099550] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccu=
 rate wcc data (ctime) detected, disabling wcc (ctime 1748883191.385396294 1=
 748883191.385396294, mtime 1748883191.385396294 1748883191.385396294) [ 112=
 832.426073] diskstation6.e-utp.net:/volume1/homes/drixter: re-enabling wcc =
 [ 112853.086255] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate =
 wcc data (ctime) detected, disabling wcc (ctime 1748891953.379970261 174889=
 1953.379970261, mtime 1748891953.379970261 1748891953.379970261) [ 530900.5=
 89197] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-enabling wcc=
  [ 530982.569922] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inac=
 curate wcc data (ctime) detected, disabling wcc (ctime 1749310082.858985530=
  1749310082.858985530, mtime 1749310082.858985530 1749310082.858985530)

 The logs messages in kernel, still appears, even with noac option, the side=
 -effect is that NFS is quite slow right now when processing multiple small =
 files.
 I suggest maybe to move forward with my idea to control it via DEBUG and./o=
 r sysctl variable if possible.

 Thanks,

 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: netbsd-bugs-owner@NetBSD.org <netbsd-bugs-owner@NetBSD.org> On Behalf=
  Of Marcin Gondek
 Sent: Sunday, June 1, 2025 2:07 PM
 To: gnats-bugs@netbsd.org; kern-bug-people@netbsd.org; gnats-admin@netbsd.o=
 rg; netbsd-bugs@netbsd.org
 Subject: RE: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 Hi Michael

 I've setup now as you suggested, It's the same, box restarted to be sure:

 [   190.659022] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate w=
 cc data (ctime) detected, disabling wcc (ctime 1748779290.941608597 1748779=
 290.941608597, mtime 1748779290.941608597 1748779290.941608597)

 devil# mount -vv | grep drixter | grep noac diskstation6.e-utp.net:/volume1=
 /homes/drixter on /home/users/drixter type nfs (automounted, fsid: 0xb0e/0x=
 70b, reads: sync 0 async 0, writes: sync 0 async 0, [nfs: addr=3D2001:67c:2=
 1ec:ffee:18f2:a77c:dc08:aef6, port=3D2049, addrlen=3D28, sotype=3D1, proto=
 =3D0, fhsize=3D0, flags=3D0x88247<soft,wsize,rsize,intr,nfsv3,resvport,noac=
 >, wsize=3D8192, rsize=3D8192, readdirsize=3D4096, timeo=3D300, retrans=3D1=
 0, maxgrouplist=3D16, readahead=3D2, leaseterm=3D0, deadthresh=3D9]) devil#

 devil# cat /etc/auto_homes
 * -rw,noac,soft,intr,rsize=3D8192,wsize=3D8192 diskstation6.e-utp.net:/volu=
 me1/homes/&

 noac is included.


 Thanks,

 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: netbsd-bugs-owner@NetBSD.org <netbsd-bugs-owner@NetBSD.org> On Behalf=
  Of Michael van Elst via gnats
 Sent: Sunday, June 1, 2025 1:45 PM
 To: kern-bug-people@netbsd.org; gnats-admin@netbsd.org; netbsd-bugs@netbsd.=
 org; Marcin Gondek <drixter@e-utp.net>
 Subject: Re: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 The following reply was made to PR kern/59452; it has been noted by GNATS.

 From: mlelstv@serpens.de (Michael van Elst)
 To: gnats-bugs@netbsd.org
 Cc:=20
 Subject: Re: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.
 Date: Sun, 1 Jun 2025 11:41:06 -0000 (UTC)

  drixter@e-utp.net writes:
 =20
  >I know that such messages should not generally appear if the NFS server i=
 s working properly. But unfortunately it is not repairable everywhere -> Sy=
 nology NFS, hence the question about the possibility of moving these messag=
 es to the DEBUG variant or maybe make it controlable via sysctl.
 =20
  >[ 514378.384585] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-=
 enabling wcc  >[ 514557.066122] diskstation6.e-utp.net:/volume1/Application=
 s/NetBSD: inaccurate wcc data (ctime) detected, disabling wcc (ctime 174837=
 4671.270579777 1748374671.270579777, mtime 1748374671.270579777 1748374671.=
 270579777)
 =20
  Most of the messages appear to be "re-enabling" + "disabling wcc" again wi=
 thin a few seconds.
 =20
  What happens when you just disable the attribute cache when mounting with =
 'mount -o noac' ? It's hardly used anyway.
 =20

From: Marcin Gondek <drixter@e-utp.net>
To: "gnats-bugs@netbsd.org" <gnats-bugs@netbsd.org>,
	"kern-bug-people@netbsd.org" <kern-bug-people@netbsd.org>,
	"gnats-admin@netbsd.org" <gnats-admin@netbsd.org>, "netbsd-bugs@netbsd.org"
	<netbsd-bugs@netbsd.org>
Cc: 
Subject: RE: kern/59452: Move NFS wcc data messages to debug or control them
 via sysctl.
Date: Wed, 22 Oct 2025 19:08:42 +0000

 Hi All,

 I've made a patch for myself to disable it via ifdef, probably this is not =
 proper way, but my system is getting spam on high load over NFS.

 Now observing that is better or not, as far I'm not C developer I hope that=
  there is no other side effect.

 The good thing is that kernel compile correctly. First my approach was only=
  theory now time for practice ;-)


 =3D=3Dcut=3D=3D
 --- nfs_clntsubs.c      2025-10-22 21:00:13.919594789 +0200
 +++ nfs_clntsubs.c-IFDEF        2025-10-22 19:38:56.907354570 +0200
 @@ -393,15 +393,20 @@
                 time_t now =3D time_second;
                 const struct timespec *omtime =3D &np->n_vattr->va_mtime;
                 const struct timespec *octime =3D &np->n_vattr->va_ctime;
 +#ifdef DEBUG
                 const char *reason =3D NULL; /* XXX: gcc */
 -
 +#endif
                 if (timespeccmp(omtime, mtime, <=3D)) {
 +#ifdef DEBUG
                         reason =3D "mtime";
 +#endif
                         error =3D EINVAL;
                 }

                 if (vp->v_type =3D=3D VDIR && timespeccmp(octime, ctime, <=
 =3D)) {
 +#ifdef DEBUG
                         reason =3D "ctime";
 +#endif
                         error =3D EINVAL;
                 }

 @@ -423,6 +428,7 @@
                          */

                         mutex_enter(&nmp->nm_lock);
 +#ifdef DEBUG
                         if (!NFS_WCCKLUDGE(nmp, now)) {
                                 printf("%s: inaccurate wcc data (%s) detect=
 ed,"
                                     " disabling wcc"
 @@ -439,6 +445,7 @@
                                     (unsigned int)mtime->tv_sec,
                                     (unsigned int)mtime->tv_nsec);
                         }
 +#endif
                         nmp->nm_iflag |=3D NFSMNT_WCCKLUDGE;
                         nmp->nm_wcckludgetime =3D now;
                         mutex_exit(&nmp->nm_lock);
 @@ -447,8 +454,10 @@
                 } else if (nmp->nm_iflag & NFSMNT_WCCKLUDGE) {
                         mutex_enter(&nmp->nm_lock);
                         if (nmp->nm_iflag & NFSMNT_WCCKLUDGE) {
 +#ifdef DEBUG
                                 printf("%s: re-enabling wcc\n",
                                     vp->v_mount->mnt_stat.f_mntfromname);
 +#endif
                                 nmp->nm_iflag &=3D ~NFSMNT_WCCKLUDGE;
                         }
                         mutex_exit(&nmp->nm_lock);
 =3D=3Dcut=3D=3D


 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: netbsd-bugs-owner@NetBSD.org <netbsd-bugs-owner@NetBSD.org> On Behalf=
  Of Marcin Gondek
 Sent: Thursday, July 24, 2025 10:17 AM
 To: gnats-bugs@netbsd.org; kern-bug-people@netbsd.org; gnats-admin@netbsd.o=
 rg; netbsd-bugs@netbsd.org
 Subject: RE: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 Hi All,

 Is there any chance that someone will change it?
 I know that is rare case, but for my boxes I'm getting spam in dmesg on eve=
 ry high load ;-/ With noac option there is a less spam but performance is s=
 ignificantly degraded.

 Thanks,


 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: Marcin Gondek
 Sent: Monday, June 9, 2025 12:48 PM
 To: Marcin Gondek <drixter@e-utp.net>; gnats-bugs@netbsd.org; kern-bug-peop=
 le@netbsd.org; gnats-admin@netbsd.org; netbsd-bugs@netbsd.org
 Subject: RE: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 Hi.

 [   190.659022] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate w=
 cc data (ctime) detected, disabling wcc (ctime 1748779290.941608597 1748779=
 290.941608597, mtime 1748779290.941608597 1748779290.941608597)
 [ 14577.965578] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccu=
 rate wcc data (ctime) detected, disabling wcc (ctime 1748793678.251985388 1=
 748793678.251985388, mtime 1748793678.251985388 1748793678.251985388) [ 398=
 26.666864] diskstation6.e-utp.net:/volume1/Applications/html: inaccurate wc=
 c data (ctime) detected, disabling wcc (ctime 1748818926.951985610 17488189=
 26.951985610, mtime 1748818926.951985610 1748818926.951985610) [ 103278.442=
 441] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-enabling wcc [=
  104091.099550] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inaccu=
 rate wcc data (ctime) detected, disabling wcc (ctime 1748883191.385396294 1=
 748883191.385396294, mtime 1748883191.385396294 1748883191.385396294) [ 112=
 832.426073] diskstation6.e-utp.net:/volume1/homes/drixter: re-enabling wcc =
 [ 112853.086255] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate =
 wcc data (ctime) detected, disabling wcc (ctime 1748891953.379970261 174889=
 1953.379970261, mtime 1748891953.379970261 1748891953.379970261) [ 530900.5=
 89197] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-enabling wcc=
  [ 530982.569922] diskstation6.e-utp.net:/volume1/Applications/NetBSD: inac=
 curate wcc data (ctime) detected, disabling wcc (ctime 1749310082.858985530=
  1749310082.858985530, mtime 1749310082.858985530 1749310082.858985530)

 The logs messages in kernel, still appears, even with noac option, the side=
 -effect is that NFS is quite slow right now when processing multiple small =
 files.
 I suggest maybe to move forward with my idea to control it via DEBUG and./o=
 r sysctl variable if possible.

 Thanks,

 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: netbsd-bugs-owner@NetBSD.org <netbsd-bugs-owner@NetBSD.org> On Behalf=
  Of Marcin Gondek
 Sent: Sunday, June 1, 2025 2:07 PM
 To: gnats-bugs@netbsd.org; kern-bug-people@netbsd.org; gnats-admin@netbsd.o=
 rg; netbsd-bugs@netbsd.org
 Subject: RE: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 Hi Michael

 I've setup now as you suggested, It's the same, box restarted to be sure:

 [   190.659022] diskstation6.e-utp.net:/volume1/homes/drixter: inaccurate w=
 cc data (ctime) detected, disabling wcc (ctime 1748779290.941608597 1748779=
 290.941608597, mtime 1748779290.941608597 1748779290.941608597)

 devil# mount -vv | grep drixter | grep noac diskstation6.e-utp.net:/volume1=
 /homes/drixter on /home/users/drixter type nfs (automounted, fsid: 0xb0e/0x=
 70b, reads: sync 0 async 0, writes: sync 0 async 0, [nfs: addr=3D2001:67c:2=
 1ec:ffee:18f2:a77c:dc08:aef6, port=3D2049, addrlen=3D28, sotype=3D1, proto=
 =3D0, fhsize=3D0, flags=3D0x88247<soft,wsize,rsize,intr,nfsv3,resvport,noac=
 >, wsize=3D8192, rsize=3D8192, readdirsize=3D4096, timeo=3D300, retrans=3D1=
 0, maxgrouplist=3D16, readahead=3D2, leaseterm=3D0, deadthresh=3D9]) devil#

 devil# cat /etc/auto_homes
 * -rw,noac,soft,intr,rsize=3D8192,wsize=3D8192 diskstation6.e-utp.net:/volu=
 me1/homes/&

 noac is included.


 Thanks,

 --
 Marcin Gondek / Drixter
 http://fido.e-utp.net/
 AS56662

 -----Original Message-----
 From: netbsd-bugs-owner@NetBSD.org <netbsd-bugs-owner@NetBSD.org> On Behalf=
  Of Michael van Elst via gnats
 Sent: Sunday, June 1, 2025 1:45 PM
 To: kern-bug-people@netbsd.org; gnats-admin@netbsd.org; netbsd-bugs@netbsd.=
 org; Marcin Gondek <drixter@e-utp.net>
 Subject: Re: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.

 The following reply was made to PR kern/59452; it has been noted by GNATS.

 From: mlelstv@serpens.de (Michael van Elst)
 To: gnats-bugs@netbsd.org
 Cc:=20
 Subject: Re: kern/59452: Move NFS wcc data messages to debug or control the=
 m via sysctl.
 Date: Sun, 1 Jun 2025 11:41:06 -0000 (UTC)

  drixter@e-utp.net writes:
 =20
  >I know that such messages should not generally appear if the NFS server i=
 s working properly. But unfortunately it is not repairable everywhere -> Sy=
 nology NFS, hence the question about the possibility of moving these messag=
 es to the DEBUG variant or maybe make it controlable via sysctl.
 =20
  >[ 514378.384585] diskstation6.e-utp.net:/volume1/Applications/NetBSD: re-=
 enabling wcc  >[ 514557.066122] diskstation6.e-utp.net:/volume1/Application=
 s/NetBSD: inaccurate wcc data (ctime) detected, disabling wcc (ctime 174837=
 4671.270579777 1748374671.270579777, mtime 1748374671.270579777 1748374671.=
 270579777)
 =20
  Most of the messages appear to be "re-enabling" + "disabling wcc" again wi=
 thin a few seconds.
 =20
  What happens when you just disable the attribute cache when mounting with =
 'mount -o noac' ? It's hardly used anyway.
 =20

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.