From: Matthew Dillon Date: Mon, 12 Jan 2009 21:46:20 +0000 (-0800) Subject: Set the auto-reflush flag if the flusher is unable to completely flush X-Git-Tag: v2.3.0~43 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/5c667a24d6f71ecb8735c064088ba0a342a05cc8 Set the auto-reflush flag if the flusher is unable to completely flush an inode due to dependencies or memory considerations. This should hopefully solve reported 'vinvalbuf: dirty bufs' panics, which occur when VOP_FSYNC() returns before the inode is completely flushed. Reported-by: "Justin C. Sherrill" --- diff --git a/sys/vfs/hammer/hammer_inode.c b/sys/vfs/hammer/hammer_inode.c index e8df385ad4..537bd19487 100644 --- a/sys/vfs/hammer/hammer_inode.c +++ b/sys/vfs/hammer/hammer_inode.c @@ -2048,6 +2048,14 @@ hammer_flush_inode_done(hammer_inode_t ip, int error) hmp = ip->hmp; + /* + * Auto-reflush if the backend could not completely flush + * the inode. This fixes a case where a deferred buffer flush + * could cause fsync to return early. + */ + if (ip->sync_flags & HAMMER_INODE_MODMASK) + ip->flags |= HAMMER_INODE_REFLUSH; + /* * Merge left-over flags back into the frontend and fix the state. * Incomplete truncations are retained by the backend.