summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-08-07 04:33:06 +0000
committerkib <kib@FreeBSD.org>2015-08-07 04:33:06 +0000
commitfeedc474773ef4f5d277017f1df6132d0eb74fc0 (patch)
treeef168c27c4da832dfcfb91b1df4fe34e3404495a /sys/kern/vfs_bio.c
parent984b7d731dea8738e6ddaf5aa99948e24165db69 (diff)
downloadFreeBSD-src-feedc474773ef4f5d277017f1df6132d0eb74fc0.zip
FreeBSD-src-feedc474773ef4f5d277017f1df6132d0eb74fc0.tar.gz
MFC r285384:
Do not allow creation of the dirty buffers for the dead buffer objects.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index f306b5a..8558d06 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1174,6 +1174,12 @@ bufwrite(struct buf *bp)
int vp_md;
CTR3(KTR_BUF, "bufwrite(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags);
+ if ((bp->b_bufobj->bo_flag & BO_DEAD) != 0) {
+ bp->b_flags |= B_INVAL | B_RELBUF;
+ bp->b_flags &= ~B_CACHE;
+ brelse(bp);
+ return (ENXIO);
+ }
if (bp->b_flags & B_INVAL) {
brelse(bp);
return (0);
OpenPOWER on IntegriCloud