summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2002-11-20 05:14:16 +0000
committermckusick <mckusick@FreeBSD.org>2002-11-20 05:14:16 +0000
commit637af64f544f6afdc6bfad85d6fb1706fd0907af (patch)
tree8325a4c034f34422b65c31858fa58a00c76e4130 /sys/ufs
parent13580e5c6846707466e0d71c5139f8a0f6e61926 (diff)
downloadFreeBSD-src-637af64f544f6afdc6bfad85d6fb1706fd0907af.zip
FreeBSD-src-637af64f544f6afdc6bfad85d6fb1706fd0907af.tar.gz
If an error occurs while writing a buffer, then the data will
not have hit the disk and the dependencies cannot be unrolled. In this case, the system will mark the buffer as dirty again so that the write can be retried in the future. When the write succeeds or the system gives up on the buffer and marks it as invalid (B_INVAL), the dependencies will be cleared. Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 422cabc..5a185e5 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -3935,6 +3935,12 @@ softdep_disk_write_complete(bp)
struct inodedep *inodedep;
struct bmsafemap *bmsafemap;
+ /*
+ * If an error occurred while doing the write, then the data
+ * has not hit the disk and the dependencies cannot be unrolled.
+ */
+ if ((bp->b_ioflags & BIO_ERROR) != 0 && (bp->b_flags & B_INVAL) == 0)
+ return;
#ifdef DEBUG
if (lk.lkt_held != NOHOLDER)
panic("softdep_disk_write_complete: lock is held");
OpenPOWER on IntegriCloud