From e6b12a20f453aca29cdd406d33a5d25d0e711fd8 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Fri, 20 Oct 2006 13:02:56 +0000 Subject: 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 --- sys/ufs/ffs/ffs_softdep.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3