The mail I wrote earlier seems to have vanished from my mail queue
without trace, so here's a resend.
Several of the vn_ and VOP functions take a struct proc as an argument,
it doesn't actually ever make sense for this to be anything other than
curproc (removing the argument is part of thib's planned vnode rework,
but for now having it correct means less crashes, so is inherently good).
However, a recent vnd + softraid panic I saw lead me to find out that
several callers in the tree are calling these functions with NULL (or
even 0, ick) for the proc pointer, that is all kinda of wrong.
Especially in the case of VOP_IOCTL which ahs good reasons to expect a
valid proc pointer will always be there.
This diff is the result of systematically checking every caller of a VOP
or vn_ function that takes a proc and fixing the wrong ones. Doing so
also reminded me how nasty some of our vfs bits are.
jsing and mikeb tested the softraid bits, pea, matthieu and naddy tested
the raidframe bits. The rest is running on the machine I am typing this
mail from and has caused no problems.
thib@ has already oked this diff, but more review and tests are never a
bad thing.
so, any more oks, tests or comments?
Cheers,
-0-
--
"In short, _N is Richardian if, and only if, _N is not Richardian."
Index: dev/softraid.c
===================================================================
RCS file: /cvs/src/sys/dev/softraid.c,v
retrieving revision 1.213
diff -u -p -r1.213 softraid.c
--- dev/softraid.c 7 Sep 2010 17:14:06 -0000 1.213
+++ dev/softraid.c 20 Sep 2010 23:23:41 -0000
@@ -322,7 +322,7 @@ sr_meta_probe(struct sr_discipline *sd,
* XXX leaving dev open for now; move this to attach
* and figure out the open/close dance for unwind.
*/
- error = VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0);
+ error = VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META,"%s: sr_meta_probe can't "
"open %s\n", DEVNAME(sc), devname);
@@ -900,7 +900,7 @@ sr_meta_native_bootprobe(struct sr_softc
}
/* open device */
- error = VOP_OPEN(vn, FREAD, NOCRED, 0);
+ error = VOP_OPEN(vn, FREAD, NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: sr_meta_native_bootprobe open "
"failed\n", DEVNAME(sc));
@@ -909,17 +909,18 @@ sr_meta_native_bootprobe(struct sr_softc
}
/* get disklabel */
- error = VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0);
+ error = VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED,
+ curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: sr_meta_native_bootprobe ioctl "
"failed\n", DEVNAME(sc));
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
goto done;
}
/* we are done, close device */
- error = VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ error = VOP_CLOSE(vn, FREAD, NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: sr_meta_native_bootprobe close "
"failed\n", DEVNAME(sc));
@@ -957,7 +958,7 @@ sr_meta_native_bootprobe(struct sr_softc
"vnode for partition\n", DEVNAME(sc));
goto done;
}
- error = VOP_OPEN(vn, FREAD, NOCRED, 0);
+ error = VOP_OPEN(vn, FREAD, NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: sr_meta_native_bootprobe "
"open failed, partition %d\n",
@@ -969,14 +970,14 @@ sr_meta_native_bootprobe(struct sr_softc
if (sr_meta_native_read(fake_sd, rawdev, md, NULL)) {
printf("%s: native bootprobe could not read native "
"metadata\n", DEVNAME(sc));
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
continue;
}
/* are we a softraid partition? */
if (md->ssdi.ssd_magic != SR_MAGIC) {
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
continue;
}
@@ -999,7 +1000,7 @@ sr_meta_native_bootprobe(struct sr_softc
}
/* we are done, close partition */
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
}
@@ -1368,7 +1369,7 @@ sr_meta_native_probe(struct sr_softc *sc
/* get disklabel */
error = VOP_IOCTL(ch_entry->src_vn, DIOCGDINFO, (caddr_t)&label, FREAD,
- NOCRED, 0);
+ NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: %s can't obtain disklabel\n",
DEVNAME(sc), devname);
@@ -2374,7 +2375,7 @@ sr_hotspare(struct sr_softc *sc, dev_t d
printf("%s:, sr_hotspare: can't allocate vnode\n", DEVNAME(sc));
goto done;
}
- if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0)) {
+ if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc)) {
DNPRINTF(SR_D_META,"%s: sr_hotspare cannot open %s\n",
DEVNAME(sc), devname);
vput(vn);
@@ -2384,10 +2385,11 @@ sr_hotspare(struct sr_softc *sc, dev_t d
/* Get partition details. */
part = DISKPART(dev);
- if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0)) {
+ if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD,
+ NOCRED, curproc)) {
DNPRINTF(SR_D_META, "%s: sr_hotspare ioctl failed\n",
DEVNAME(sc));
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
goto fail;
}
@@ -2498,7 +2500,7 @@ done:
if (sm)
free(sm, M_DEVBUF);
if (open) {
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
}
@@ -2671,7 +2673,7 @@ sr_rebuild_init(struct sr_discipline *sd
goto done;
}
- if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0)) {
+ if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc)) {
DNPRINTF(SR_D_META,"%s: sr_ioctl_setstate can't "
"open %s\n", DEVNAME(sc), devname);
vput(vn);
@@ -2681,7 +2683,8 @@ sr_rebuild_init(struct sr_discipline *sd
/* get partition */
part = DISKPART(dev);
- if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0)) {
+ if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD,
+ NOCRED, curproc)) {
DNPRINTF(SR_D_META, "%s: sr_ioctl_setstate ioctl failed\n",
DEVNAME(sc));
goto done;
@@ -2745,7 +2748,7 @@ sr_rebuild_init(struct sr_discipline *sd
rv = 0;
done:
if (open) {
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
}
@@ -3318,8 +3321,10 @@ sr_chunks_unwind(struct sr_softc *sc, st
* the problem introduced by vnode aliasing... specfs
* has no locking, whereas ufs/ffs does!
*/
- vn_lock(ch_entry->src_vn, LK_EXCLUSIVE | LK_RETRY, 0);
- VOP_CLOSE(ch_entry->src_vn, FREAD | FWRITE, NOCRED, 0);
+ vn_lock(ch_entry->src_vn, LK_EXCLUSIVE |
+ LK_RETRY, curproc);
+ VOP_CLOSE(ch_entry->src_vn, FREAD | FWRITE, NOCRED,
+ curproc);
vput(ch_entry->src_vn);
}
free(ch_entry, M_DEVBUF);
Index: dev/softraid_crypto.c
===================================================================
RCS file: /cvs/src/sys/dev/softraid_crypto.c,v
retrieving revision 1.54
diff -u -p -r1.54 softraid_crypto.c
--- dev/softraid_crypto.c 2 Jul 2010 09:26:05 -0000 1.54
+++ dev/softraid_crypto.c 20 Sep 2010 17:10:26 -0000
@@ -674,7 +674,7 @@ sr_crypto_create_key_disk(struct sr_disc
DEVNAME(sc));
goto done;
}
- if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0)) {
+ if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc)) {
DNPRINTF(SR_D_META,"%s: sr_create_key_disk cannot open %s\n",
DEVNAME(sc), devname);
vput(vn);
@@ -684,10 +684,11 @@ sr_crypto_create_key_disk(struct sr_disc
/* Get partition details. */
part = DISKPART(dev);
- if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0)) {
+ if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label,
+ FREAD, NOCRED, curproc)) {
DNPRINTF(SR_D_META, "%s: sr_create_key_disk ioctl failed\n",
DEVNAME(sc));
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
goto fail;
}
@@ -798,7 +799,7 @@ done:
if (sm)
free(sm, M_DEVBUF);
if (open) {
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
}
@@ -836,7 +837,7 @@ sr_crypto_read_key_disk(struct sr_discip
DEVNAME(sc));
goto done;
}
- if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0)) {
+ if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc)) {
DNPRINTF(SR_D_META,"%s: sr_create_key_disk cannot open %s\n",
DEVNAME(sc), devname);
vput(vn);
@@ -846,10 +847,11 @@ sr_crypto_read_key_disk(struct sr_discip
/* Get partition details. */
part = DISKPART(dev);
- if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0)) {
+ if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD,
+ NOCRED, curproc)) {
DNPRINTF(SR_D_META, "%s: sr_create_key_disk ioctl failed\n",
DEVNAME(sc));
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
goto done;
}
@@ -928,7 +930,7 @@ done:
free(sm, M_DEVBUF);
if (vn && open) {
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
}
Index: dev/raidframe/rf_disks.c
===================================================================
RCS file: /cvs/src/sys/dev/raidframe/rf_disks.c,v
retrieving revision 1.14
diff -u -p -r1.14 rf_disks.c
--- dev/raidframe/rf_disks.c 23 May 2010 13:49:35 -0000 1.14
+++ dev/raidframe/rf_disks.c 20 Sep 2010 19:19:44 -0000
@@ -598,7 +598,7 @@ rf_AutoConfigureDisks(RF_Raid_t *raidPtr
ac = auto_config;
while(ac != NULL) {
if (ac->flag == 0) {
- VOP_CLOSE(ac->vp, FREAD, NOCRED, 0);
+ VOP_CLOSE(ac->vp, FREAD, NOCRED, curproc);
vput(ac->vp);
ac->vp = NULL;
#if DEBUG
Index: dev/raidframe/rf_openbsdkintf.c
===================================================================
RCS file: /cvs/src/sys/dev/raidframe/rf_openbsdkintf.c,v
retrieving revision 1.58
diff -u -p -r1.58 rf_openbsdkintf.c
--- dev/raidframe/rf_openbsdkintf.c 8 Sep 2010 14:47:12 -0000 1.58
+++ dev/raidframe/rf_openbsdkintf.c 20 Sep 2010 19:20:30 -0000
@@ -2720,7 +2720,7 @@ rf_find_raid_components(void)
if (bdevvp(dev, &vp))
panic("RAID can't alloc vnode");
- error = VOP_OPEN(vp, FREAD, NOCRED, 0);
+ error = VOP_OPEN(vp, FREAD, NOCRED, curproc);
if (error) {
/*
@@ -2733,7 +2733,7 @@ rf_find_raid_components(void)
/* Ok, the disk exists. Go get the disklabel. */
error = VOP_IOCTL(vp, DIOCGDINFO, (caddr_t)&label,
- FREAD, NOCRED, 0);
+ FREAD, NOCRED, curproc);
if (error) {
/*
* XXX can't happen - open() would
@@ -2747,7 +2747,7 @@ rf_find_raid_components(void)
* We don't need this any more. We'll allocate it again
* a little later if we really do...
*/
- VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, curproc);
vrele(vp);
for (i=0; i < label.d_npartitions; i++) {
@@ -2770,7 +2770,7 @@ rf_find_raid_components(void)
if (bdevvp(dev, &vp))
panic("RAID can't alloc vnode");
- error = VOP_OPEN(vp, FREAD, NOCRED, 0);
+ error = VOP_OPEN(vp, FREAD, NOCRED, curproc);
if (error) {
/* Whatever... */
vput(vp);
@@ -2825,7 +2825,7 @@ rf_find_raid_components(void)
if (!good_one) {
/* Cleanup. */
free(clabel, M_RAIDFRAME);
- VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, curproc);
vrele(vp);
}
}
@@ -3328,7 +3328,7 @@ rf_release_all_vps(RF_ConfigSet_t *cset)
while(ac!=NULL) {
/* Close the vp, and give it back. */
if (ac->vp) {
- VOP_CLOSE(ac->vp, FREAD, NOCRED, 0);
+ VOP_CLOSE(ac->vp, FREAD, NOCRED, curproc);
vrele(ac->vp);
ac->vp = NULL;
}
Index: kern/subr_disk.c
===================================================================
RCS file: /cvs/src/sys/kern/subr_disk.c,v
retrieving revision 1.109
diff -u -p -r1.109 subr_disk.c
--- kern/subr_disk.c 8 Sep 2010 15:16:22 -0000 1.109
+++ kern/subr_disk.c 20 Sep 2010 22:50:59 -0000
@@ -1303,7 +1303,7 @@ disk_readlabel(struct disklabel *dl, dev
return (errbuf);
}
- error = VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)dl, FREAD, NOCRED, 0);
+ error = VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)dl, FREAD, NOCRED, curproc);
if (error) {
snprintf(errbuf, sizeof(errbuf),
"cannot read disk label, 0x%x/0x%x, error %d",
@@ -1311,7 +1311,7 @@ disk_readlabel(struct disklabel *dl, dev
return (errbuf);
}
- error = VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ error = VOP_CLOSE(vn, FREAD, NOCRED, curproc);
if (error) {
snprintf(errbuf, sizeof(errbuf),
"cannot close disk, 0x%x/0x%x, error %d",
Index: miscfs/procfs/procfs_vfsops.c
===================================================================
RCS file: /cvs/src/sys/miscfs/procfs/procfs_vfsops.c,v
retrieving revision 1.25
diff -u -p -r1.25 procfs_vfsops.c
--- miscfs/procfs/procfs_vfsops.c 18 Jun 2007 08:30:07 -0000 1.25
+++ miscfs/procfs/procfs_vfsops.c 20 Sep 2010 23:52:22 -0000
@@ -149,7 +149,7 @@ procfs_root(struct mount *mp, struct vno
error = procfs_allocvp(mp, vpp, 0, Proot);
if (error)
return (error);
- vn_lock(*vpp, LK_EXCLUSIVE, curproc);
+ vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curproc);
return (0);
}
Index: msdosfs/msdosfs_vfsops.c
===================================================================
RCS file: /cvs/src/sys/msdosfs/msdosfs_vfsops.c,v
retrieving revision 1.57
diff -u -p -r1.57 msdosfs_vfsops.c
--- msdosfs/msdosfs_vfsops.c 24 Jan 2010 18:12:46 -0000 1.57
+++ msdosfs/msdosfs_vfsops.c 20 Sep 2010 23:10:38 -0000
@@ -135,11 +135,9 @@ msdosfs_mount(struct mount *mp, const ch
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
error = VOP_ACCESS(devvp, VREAD | VWRITE,
p->p_ucred, p);
- if (error) {
- VOP_UNLOCK(devvp, 0, p);
- return (error);
- }
VOP_UNLOCK(devvp, 0, p);
+ if (error)
+ return (error);
}
pmp->pm_flags &= ~MSDOSFSMNT_RONLY;
}
Index: nnpfs/nnpfs_vnodeops.h
===================================================================
RCS file: /cvs/src/sys/nnpfs/nnpfs_vnodeops.h,v
retrieving revision 1.2
diff -u -p -r1.2 nnpfs_vnodeops.h
--- nnpfs/nnpfs_vnodeops.h 9 Jul 2009 22:29:56 -0000 1.2
+++ nnpfs/nnpfs_vnodeops.h 20 Sep 2010 22:42:12 -0000
@@ -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)
Index: ufs/ext2fs/ext2fs_lookup.c
===================================================================
RCS file: /cvs/src/sys/ufs/ext2fs/ext2fs_lookup.c,v
retrieving revision 1.25
diff -u -p -r1.25 ext2fs_lookup.c
--- ufs/ext2fs/ext2fs_lookup.c 9 Jul 2009 22:29:56 -0000 1.25
+++ ufs/ext2fs/ext2fs_lookup.c 20 Sep 2010 23:33:56 -0000
@@ -969,7 +969,7 @@ ext2fs_dirempty(struct inode *ip, ino_t
for (off = 0; off < ext2fs_size(ip); off += fs2h16(dp->e2d_reclen)) {
error = vn_rdwr(UIO_READ, ITOV(ip), (caddr_t)dp, MINDIRSIZ, off,
- UIO_SYSSPACE, IO_NODELOCKED, cred, &count, (struct proc *)0);
+ UIO_SYSSPACE, IO_NODELOCKED, cred, &count, curproc);
/*
* Since we read MINDIRSIZ, residual must
* be 0 unless we're at end of file.
@@ -1033,8 +1033,8 @@ ext2fs_checkpath(struct inode *source, s
}
error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf,
sizeof (struct ext2fs_dirtemplate), (off_t)0,
- UIO_SYSSPACE, IO_NODELOCKED, cred, (size_t *)0,
- (struct proc *)0);
+ UIO_SYSSPACE, IO_NODELOCKED, cred, NULL,
+ curproc);
if (error != 0)
break;
namlen = dirbuf.dotdot_namlen;
Index: ufs/ext2fs/ext2fs_vfsops.c
===================================================================
RCS file: /cvs/src/sys/ufs/ext2fs/ext2fs_vfsops.c,v
retrieving revision 1.57
diff -u -p -r1.57 ext2fs_vfsops.c
--- ufs/ext2fs/ext2fs_vfsops.c 10 Sep 2010 16:34:09 -0000 1.57
+++ ufs/ext2fs/ext2fs_vfsops.c 20 Sep 2010 23:11:50 -0000
@@ -226,11 +226,9 @@ ext2fs_mount(struct mount *mp, const cha
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
error = VOP_ACCESS(devvp, VREAD | VWRITE,
p->p_ucred, p);
- if (error) {
- VOP_UNLOCK(devvp, 0, p);
- return (error);
- }
VOP_UNLOCK(devvp, 0, p);
+ if (error)
+ return (error);
}
fs->e2fs_ronly = 0;
if (fs->e2fs.e2fs_state == E2FS_ISCLEAN)
Index: ufs/ext2fs/ext2fs_vnops.c
===================================================================
RCS file: /cvs/src/sys/ufs/ext2fs/ext2fs_vnops.c,v
retrieving revision 1.56
diff -u -p -r1.56 ext2fs_vnops.c
--- ufs/ext2fs/ext2fs_vnops.c 10 Sep 2010 16:34:09 -0000 1.56
+++ ufs/ext2fs/ext2fs_vnops.c 20 Sep 2010 23:34:09 -0000
@@ -826,7 +826,7 @@ abortit:
error = vn_rdwr(UIO_READ, fvp, (caddr_t)&dirbuf,
sizeof (struct ext2fs_dirtemplate), (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED,
- tcnp->cn_cred, (size_t *)0, (struct proc *)0);
+ tcnp->cn_cred, NULL, curproc);
if (error == 0) {
namlen = dirbuf.dotdot_namlen;
if (namlen != 2 ||
@@ -841,8 +841,7 @@ abortit:
sizeof (struct dirtemplate),
(off_t)0, UIO_SYSSPACE,
IO_NODELOCKED|IO_SYNC,
- tcnp->cn_cred, (size_t *)0,
- (struct proc *)0);
+ tcnp->cn_cred, NULL, curproc);
cache_purge(fdvp);
}
}
@@ -951,7 +950,7 @@ ext2fs_mkdir(void *v)
dirtemplate.dotdot_name[0] = dirtemplate.dotdot_name[1] = '.';
error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)&dirtemplate,
sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE,
- IO_NODELOCKED|IO_SYNC, cnp->cn_cred, (size_t *)0, (struct proc *)0);
+ IO_NODELOCKED|IO_SYNC, cnp->cn_cred, NULL, curproc);
if (error) {
dp->i_e2fs_nlink--;
dp->i_flag |= IN_CHANGE;
@@ -1095,7 +1094,7 @@ ext2fs_symlink(void *v)
} else
error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED, ap->a_cnp->cn_cred, NULL,
- (struct proc *)0);
+ curproc);
bad:
vput(vp);
return (error);
Index: ufs/ufs/ufs_lookup.c
===================================================================
RCS file: /cvs/src/sys/ufs/ufs/ufs_lookup.c,v
retrieving revision 1.39
diff -u -p -r1.39 ufs_lookup.c
--- ufs/ufs/ufs_lookup.c 20 Apr 2010 22:05:44 -0000 1.39
+++ ufs/ufs/ufs_lookup.c 20 Sep 2010 23:20:24 -0000
@@ -1076,7 +1076,7 @@ ufs_dirempty(struct inode *ip, ino_t par
m = DIP(ip, size);
for (off = 0; off < m; off += dp->d_reclen) {
error = vn_rdwr(UIO_READ, ITOV(ip), (caddr_t)dp, MINDIRSIZ, off,
- UIO_SYSSPACE, IO_NODELOCKED, cred, &count, (struct proc *)0);
+ UIO_SYSSPACE, IO_NODELOCKED, cred, &count, curproc);
/*
* Since we read MINDIRSIZ, residual must
* be 0 unless we're at end of file.
@@ -1145,7 +1145,7 @@ ufs_checkpath(struct inode *source, stru
}
error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf,
sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE,
- IO_NODELOCKED, cred, NULL, (struct proc *)0);
+ IO_NODELOCKED, cred, NULL, curproc);
if (error != 0)
break;
# if (BYTE_ORDER == LITTLE_ENDIAN)
Index: ufs/ufs/ufs_vnops.c
===================================================================
RCS file: /cvs/src/sys/ufs/ufs/ufs_vnops.c,v
retrieving revision 1.95
diff -u -p -r1.95 ufs_vnops.c
--- ufs/ufs/ufs_vnops.c 10 Sep 2010 16:34:09 -0000 1.95
+++ ufs/ufs/ufs_vnops.c 20 Sep 2010 23:20:32 -0000
@@ -1357,7 +1357,7 @@ ufs_symlink(void *v)
} else
error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED, ap->a_cnp->cn_cred, NULL,
- (struct proc *)0);
+ curproc);
vput(vp);
return (error);
}