summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
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