diff options
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index fa6ee58..c18795b 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1253,10 +1253,12 @@ brelse(struct buf * bp) * cannot be set while we hold the buf lock, it can only be * cleared if it is already pending. */ - VI_LOCK(bp->b_vp); - if (!(bp->b_vflags & BV_BKGRDINPROG)) - bp->b_flags |= B_RELBUF; - VI_UNLOCK(bp->b_vp); + if (bp->b_vp) { + VI_LOCK(bp->b_vp); + if (!(bp->b_vflags & BV_BKGRDINPROG)) + bp->b_flags |= B_RELBUF; + VI_UNLOCK(bp->b_vp); + } } /* |