Summary: | nfs client panic with non-sleepable locks on 14.0-CURRENT main-n246340-01bad87a76d | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Masachika ISHIZUKA <ish> | ||||||
Component: | kern | Assignee: | Rick Macklem <rmacklem> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Only Me | CC: | rmacklem | ||||||
Priority: | --- | Keywords: | crash | ||||||
Version: | CURRENT | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Masachika ISHIZUKA
2021-04-27 04:27:46 UTC
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(-) |