Created attachment 224466 [details] core.txt On 14.0-CURRENT main-n246340-01bad87a76d Kernel page fault with the following non-sleepable locks held: exclusive sleep mutex nfs_clstate_mutex (nfs_clstate_mutex) r = 0 (0xffffffff81e7e640) locked @ /usr/src/sys/fs/nfsclient/nfs_clstate.c:3303 # cat info.last Dump header from device: /dev/gpt/fbswap Architecture: amd64 Architecture Version: 2 Dump Length: 609054720 Blocksize: 512 Compression: none Dumptime: 2021-04-27 12:42:40 +0900 Hostname: carrot.ish.org Magic: FreeBSD Kernel Dump Version String: FreeBSD 14.0-CURRENT #31 main-n246340-01bad87a76d-dirty: Tue Apr 27 11:51:50 JST 2021 ishizuka@okra.ish.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC Panic String: page fault Dump Parity: 732936796 Bounds: 3 Dump Status: good vmcore.3 was saved on https://www.ish.org/files/vmcore.3-n246340.xz
A couple of questions? - Did this happen during normal operation or during a umount? - Are delegations enabled on your server and nfscbd(8) running in the client?
Ok. I looked at the attachment and, yes, I can see it was an unmount. I'll put a patch here soon that I think will fix it.
Created attachment 224479 [details] add check for NULL and forced dismounts for nfscl_delegreturnvp() A recent commit to main added a function called nfscl_delegreturnvp() to return delegations during VOP_RECLAIM(). The function erroneously assumed that nm_clp would be non-NULL. It will be NULL for NFSV4.0 mounts until a regular file is opened. It will also be NULL during vflush() in the NFS VFS_UNMOUNT() for a forced dismount. This patch adds a check for clp == NULL to fix this. Also, since it makes no sense to call nfscl_delegreturnvp() during a forced dismount, the patch adds a check for that case.
The patch in the attachment will be committed soon. Hopefully the reporter can confirm it fixes the problem for them.
Thank you for patch. This patch seems to solve my problem. Applying this path to main-n246364-db8c27f4991, autounmountd can successfully unmount after 10 minutes.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f6fec55fe30088bbefd3efe70b62565399a7b9b8 commit f6fec55fe30088bbefd3efe70b62565399a7b9b8 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2021-04-28 00:30:16 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2021-04-28 00:30:16 +0000 nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp() Commit aad780464fad added a function called nfscl_delegreturnvp() to return delegations during the NFS VOP_RECLAIM(). The function erroneously assumed that nm_clp would be non-NULL. It will be NULL for NFSV4.0 mounts until a regular file is opened. It will also be NULL during vflush() in nfs_unmount() for a forced dismount. This patch adds a check for clp == NULL to fix this. Also, since it makes no sense to call nfscl_delegreturnvp() during a forced dismount, the patch adds a check for that case and does not do the call during forced dismounts. PR: 255436 Reported by: ish@amail.plala.or.jp MFC after: 2 weeks sys/fs/nfsclient/nfs_clnode.c | 9 ++++++++- sys/fs/nfsclient/nfs_clstate.c | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-)
Since I believe the patch committed to main should have fixed the problem, I will close this PR.
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f6bc043b7a16529fa475b1759011a1bdf83f9652 commit f6bc043b7a16529fa475b1759011a1bdf83f9652 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2021-04-28 00:30:16 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2021-05-12 02:18:17 +0000 nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp() Commit aad780464fad added a function called nfscl_delegreturnvp() to return delegations during the NFS VOP_RECLAIM(). The function erroneously assumed that nm_clp would be non-NULL. It will be NULL for NFSV4.0 mounts until a regular file is opened. It will also be NULL during vflush() in nfs_unmount() for a forced dismount. This patch adds a check for clp == NULL to fix this. Also, since it makes no sense to call nfscl_delegreturnvp() during a forced dismount, the patch adds a check for that case and does not do the call during forced dismounts. PR: 255436 (cherry picked from commit f6fec55fe30088bbefd3efe70b62565399a7b9b8) sys/fs/nfsclient/nfs_clnode.c | 9 ++++++++- sys/fs/nfsclient/nfs_clstate.c | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8686e00fdfac505cded6d8f4a4bcf8e51fc10349 commit 8686e00fdfac505cded6d8f4a4bcf8e51fc10349 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2021-04-28 00:30:16 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2021-05-12 02:38:42 +0000 nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp() Commit aad780464fad added a function called nfscl_delegreturnvp() to return delegations during the NFS VOP_RECLAIM(). The function erroneously assumed that nm_clp would be non-NULL. It will be NULL for NFSV4.0 mounts until a regular file is opened. It will also be NULL during vflush() in nfs_unmount() for a forced dismount. This patch adds a check for clp == NULL to fix this. Also, since it makes no sense to call nfscl_delegreturnvp() during a forced dismount, the patch adds a check for that case and does not do the call during forced dismounts. PR: 255436 (cherry picked from commit f6fec55fe30088bbefd3efe70b62565399a7b9b8) sys/fs/nfsclient/nfs_clnode.c | 10 +++++++++- sys/fs/nfsclient/nfs_clstate.c | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-)