summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2006-10-20 13:02:56 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2006-10-20 13:02:56 +0000
commite6b12a20f453aca29cdd406d33a5d25d0e711fd8 (patch)
treedd5544b91a644080c82acf085f6c2c85cb8a3cbc
parent4ccf15b08f49e2b198147a066fe1931f9b144689 (diff)
from freebsd rev1.128:
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. pedro@ ok
-rw-r--r--sys/ufs/ffs/ffs_softdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index fd1f5773bc7..552d1e6b9cd 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.77 2006/10/19 14:37:54 mickey Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.78 2006/10/20 13:02:55 mickey Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -3810,6 +3810,13 @@ 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_flags & B_ERROR) && !(bp->b_flags & B_INVAL))
+ return;
+
#ifdef DEBUG
if (lk.lkt_held != -1)
panic("softdep_disk_write_complete: lock is held");