FreeBSD Bugzilla – Attachment 198644 Details for
Bug 232673
nfs client panic: nfs_advlock traps on doomed vnode via NFS_ISV4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix crash in nfs_advlock() during forced dismount
lock.patch (text/plain), 1.21 KB, created by
Rick Macklem
on 2018-10-26 06:19:04 UTC
(
hide
)
Description:
Fix crash in nfs_advlock() during forced dismount
Filename:
MIME Type:
Creator:
Rick Macklem
Created:
2018-10-26 06:19:04 UTC
Size:
1.21 KB
patch
obsolete
>--- fs/nfsclient/nfs_clvnops.c.nolock 2018-10-26 05:21:07.014523000 -0400 >+++ fs/nfsclient/nfs_clvnops.c 2018-10-26 05:23:01.192399000 -0400 >@@ -3008,14 +3008,19 @@ nfs_advlock(struct vop_advlock_args *ap) > int ret, error = EOPNOTSUPP; > u_quad_t size; > >+ ret = NFSVOPLOCK(vp, LK_SHARED); >+ if (ret != 0) >+ return (EBADF); > if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) { >- if (vp->v_type != VREG) >+ if (vp->v_type != VREG) { >+ NFSVOPUNLOCK(vp, 0); > return (EINVAL); >+ } > if ((ap->a_flags & F_POSIX) != 0) > cred = p->p_ucred; > else > cred = td->td_ucred; >- NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); >+ NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); > if (vp->v_iflag & VI_DOOMED) { > NFSVOPUNLOCK(vp, 0); > return (EBADF); >@@ -3094,9 +3099,6 @@ nfs_advlock(struct vop_advlock_args *ap) > NFSVOPUNLOCK(vp, 0); > return (0); > } else if (!NFS_ISV4(vp)) { >- error = NFSVOPLOCK(vp, LK_SHARED); >- if (error) >- return (error); > if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { > size = VTONFS(vp)->n_size; > NFSVOPUNLOCK(vp, 0); >@@ -3119,7 +3121,8 @@ nfs_advlock(struct vop_advlock_args *ap) > NFSVOPUNLOCK(vp, 0); > } > } >- } >+ } else >+ NFSVOPUNLOCK(vp, 0); > return (error); > } >
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 232673
: 198644