FreeBSD Bugzilla – Attachment 157390 Details for
Bug 200585
[nlm] Fatal trap 9 when printing out KASSERT trying to run umount -f on an NFS share while it's trying to print out "lockd not responding" in nlm(4)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Hold the mnt credentials before vnode unlock.
1.patch (text/plain), 1.29 KB, created by
Konstantin Belousov
on 2015-06-03 07:10:18 UTC
(
hide
)
Description:
Hold the mnt credentials before vnode unlock.
Filename:
MIME Type:
Creator:
Konstantin Belousov
Created:
2015-06-03 07:10:18 UTC
Size:
1.29 KB
patch
obsolete
>diff --git a/sys/nlm/nlm_advlock.c b/sys/nlm/nlm_advlock.c >index 003a43d..456af87 100644 >--- a/sys/nlm/nlm_advlock.c >+++ b/sys/nlm/nlm_advlock.c >@@ -210,7 +210,7 @@ nlm_advlock_internal(struct vnode *vp, void *id, int op, struct flock *fl, > struct rpc_callextra ext; > struct nlm_feedback_arg nf; > AUTH *auth; >- struct ucred *cred; >+ struct ucred *cred, *cred1; > struct nlm_file_svid *ns; > int svid; > int error; >@@ -240,15 +240,17 @@ nlm_advlock_internal(struct vnode *vp, void *id, int op, struct flock *fl, > else > retries = INT_MAX; > >- if (unlock_vp) >- VOP_UNLOCK(vp, 0); >- > /* > * We need to switch to mount-point creds so that we can send >- * packets from a privileged port. >+ * packets from a privileged port. Reference mnt_cred and >+ * switch to them before unlocking the vnode, since mount >+ * point could be unmounted right after unlock. > */ > cred = td->td_ucred; > td->td_ucred = vp->v_mount->mnt_cred; >+ crhold(td->td_ucred); >+ if (unlock_vp) >+ VOP_UNLOCK(vp, 0); > > host = nlm_find_host_by_name(servername, sa, vers); > auth = authunix_create(cred); >@@ -373,7 +375,9 @@ nlm_advlock_internal(struct vnode *vp, void *id, int op, struct flock *fl, > if (ns) > nlm_free_svid(ns); > >+ cred1 = td->td_ucred; > td->td_ucred = cred; >+ crfree(cred1); > AUTH_DESTROY(auth); > > nlm_host_release(host);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 200585
:
157364
| 157390