diff options
author | dg <dg@FreeBSD.org> | 1999-01-22 08:59:05 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1999-01-22 08:59:05 +0000 |
commit | e4e8fec98ae986357cdc208b04557dba55a59266 (patch) | |
tree | 033d539e6cd9d3625e87b38ba4a895b2539bd68e /sys/kern/vfs_bio.c | |
parent | 305d248a37015a1158e19ab35e5f743f472def5e (diff) | |
download | FreeBSD-src-e4e8fec98ae986357cdc208b04557dba55a59266.zip FreeBSD-src-e4e8fec98ae986357cdc208b04557dba55a59266.tar.gz |
Don't throw away the buffer contents on a fatal write error; just mark
the buffer as still being dirty. This isn't a perfect solution, but
throwing away the buffer contents will often result in filesystem
corruption and this solution will at least correctly deal with transient
errors.
Submitted by: Kirk McKusick <mckusick@mckusick.com>
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 3664ccd..5e57271 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -11,7 +11,7 @@ * 2. Absolutely no warranty of function or purpose is made by the author * John S. Dyson. * - * $Id: vfs_bio.c,v 1.194 1999/01/21 08:29:05 dillon Exp $ + * $Id: vfs_bio.c,v 1.195 1999/01/21 09:19:33 dillon Exp $ */ /* @@ -577,7 +577,10 @@ brelse(struct buf * bp) if (bp->b_flags & B_LOCKED) bp->b_flags &= ~B_ERROR; - if ((bp->b_flags & (B_NOCACHE | B_INVAL | B_ERROR | B_FREEBUF)) || + if ((bp->b_flags & (B_READ | B_ERROR)) == B_ERROR) { + bp->b_flags &= ~B_ERROR; + bdirty(bp); + } else if ((bp->b_flags & (B_NOCACHE | B_INVAL | B_ERROR | B_FREEBUF)) || (bp->b_bufsize <= 0)) { bp->b_flags |= B_INVAL; if (LIST_FIRST(&bp->b_dep) != NULL && bioops.io_deallocate) |