summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-08-31 00:06:07 +0000
committerjeff <jeff@FreeBSD.org>2003-08-31 00:06:07 +0000
commit0008f2bb1d90e6b98f1a0fc612585a31ffd959cf (patch)
tree8b70fd2ab65aa9f5c60891abcc126739a124482e /sys/kern/vfs_bio.c
parentbb52206dba60f156a528c2e9539a344c4fa40991 (diff)
downloadFreeBSD-src-0008f2bb1d90e6b98f1a0fc612585a31ffd959cf.zip
FreeBSD-src-0008f2bb1d90e6b98f1a0fc612585a31ffd959cf.tar.gz
- In some cases bp->b_vp can be NULL in brelse, don't try to lock the
interlock in that case. Found by: alc
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c10
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);
+ }
}
/*
OpenPOWER on IntegriCloud