diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-09-23 18:49:40 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-09-23 18:49:40 +0000 |
commit | 206df040f0a173a6703ddff05fccef9372353b2e (patch) | |
tree | 5dfcd2b0e5fb6c546670363aba8abddd0c671cc4 /sys/nnpfs | |
parent | cff1a3e5da18708311dbb5d2fb178a800b031333 (diff) |
The only sensible argument for VOP_* calls that take a struct proc pointer is
curproc. A bunch of callers were passing in 0 (not even NULL, 0) as this
pointer, which was fine until the called vnode function tried to do
something with it. Typically, this code was then copy/pasted to various
parts of the tree.
Accept the facts of life and switch all of these over to passing curproc
for now until the argument can be removed.
Discovered by stsp trying to create a softraid on top of a vnd, which
crashed with a NULL deref in vndioctl.
softraid bits tested by mikeb and jsing. raidframe bits tested by pea,
matthieu and naddy. The rest tested by at least thib, jsing and myself.
ok thib@, jsing@.
Diffstat (limited to 'sys/nnpfs')
-rw-r--r-- | sys/nnpfs/nnpfs_vnodeops.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/nnpfs/nnpfs_vnodeops.h b/sys/nnpfs/nnpfs_vnodeops.h index e42ae1f63df..2dbe683450b 100644 --- a/sys/nnpfs/nnpfs_vnodeops.h +++ b/sys/nnpfs/nnpfs_vnodeops.h @@ -56,7 +56,7 @@ #define nnpfs_vfs_readlock(vp, proc) vn_lock((vp), LK_SHARED | LK_RETRY) #define nnpfs_vfs_writelock(vp, proc) vn_lock((vp), LK_EXCLUSIVE | LK_RETRY) -#define nnpfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp), 0) +#define nnpfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp), (proc)) #define nnpfs_vfs_vn_lock(vp, flags, proc) vn_lock((vp), (flags)) #elif defined(HAVE_THREE_ARGUMENT_VOP_LOCK) |