diff options
Diffstat (limited to 'sys/fs/specfs/spec_vnops.c')
-rw-r--r-- | sys/fs/specfs/spec_vnops.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 24edc69..94b6c18 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -720,11 +720,10 @@ spec_getpages(ap) bp->b_iodone = spec_getpages_iodone; /* B_PHYS is not set, but it is nice to fill this in. */ - bp->b_rcred = bp->b_wcred = curthread->td_proc->p_ucred; - if (bp->b_rcred != NOCRED) - crhold(bp->b_rcred); - if (bp->b_wcred != NOCRED) - crhold(bp->b_wcred); + KASSERT(bp->b_rcred == NOCRED, ("leaking read ucred")); + KASSERT(bp->b_wcred == NOCRED, ("leaking write ucred")); + bp->b_rcred = crhold(curthread->td_proc->p_ucred); + bp->b_wcred = crhold(curthread->td_proc->p_ucred); bp->b_blkno = blkno; bp->b_lblkno = blkno; pbgetvp(ap->a_vp, bp); |