From 3c5b12f96d65ec3bb22fd15b3de2833eadff0616 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 3 Apr 2005 10:24:03 +0000 Subject: - Now that writes to character devices supporting softupdates can generate dirty bufs even with a locked vnode, 100 retries is not that many. This should probably change from a retry count to an abort when we are no longer cleaning any buffers. - Don't call vprint() while we still hold the vnode locked. Move the call to later in the function. - Clean up a comment. --- sys/kern/vfs_default.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 6552a1f..5202e9c 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -383,7 +383,7 @@ vop_stdfsync(ap) struct bufobj *bo; struct buf *nbp; int s, error = 0; - int maxretry = 100; /* large, arbitrarily chosen */ + int maxretry = 1000; /* large, arbitrarily chosen */ VI_LOCK(vp); loop1: @@ -398,7 +398,7 @@ loop1: splx(s); /* - * Flush all dirty buffers associated with a block device. + * Flush all dirty buffers associated with a vnode. */ loop2: s = splbio(); @@ -445,11 +445,12 @@ loop2: splx(s); goto loop1; } - vprint("fsync: giving up on dirty", vp); error = EAGAIN; } } VI_UNLOCK(vp); + if (error == EAGAIN) + vprint("fsync: giving up on dirty", vp); splx(s); return (error); -- cgit v1.1