Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 1998 02:10:09 -0600 (CST)
From:      toasty@dragondata.com
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   kern/5768: Shutdown aborts syncing, when sync isn't done.
Message-ID:  <199802170810.CAA01127@shell.dragondata.com>

next in thread | raw e-mail | index | archive | help

>Number:         5768
>Category:       kern
>Synopsis:       Shutdown aborts syncing, when sync isn't done.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 17 00:20:01 PST 1998
>Last-Modified:
>Originator:     Kevin Day
>Organization:
DragonData Internet Services
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

2.2.x and -current

>Description:

	Quite often, when rebooting or shutting down a system, the drive is 
slowly syncing, but the kernel doesn't give it a chance to finish.

        Just tonight, I saw:

syncing disks: 
22 22 22 22 22 22 21 21 20 19 18 15 13 10 8 8 4 4 3 2 giving up....

It was obvious that it was going to finish, it just didn't give it enough of a 
chance.

>How-To-Repeat:

	I'm not sure why this happens sometimes, it just does. :)

>Fix:
	
        Here's a simple patch that makes it a bit more smart. If sync is 
making progress, don't stop it.

        I'm not too up on the current style/guidelines for kernel changes. 
Even though this is minor, feel free to show me the error of my ways if you 
disapprove. :)

--- kern_shutdown.c.orig	Tue Feb 17 01:52:07 1998
+++ kern_shutdown.c	Tue Feb 17 01:59:50 1998
@@ -211,6 +211,7 @@
 	if (!cold && (howto & RB_NOSYNC) == 0 && waittime < 0) {
 		register struct buf *bp;
 		int iter, nbusy;
+		int lastnbusy = 0;
 
 		waittime = 0;
 		printf("\nsyncing disks... ");
@@ -228,6 +229,9 @@
 				break;
 			printf("%d ", nbusy);
 			DELAY(40000 * iter);
+		        if (lastnbusy > nbusy)
+		        	iter = 0;
+		        lastnbusy = nbusy;
 		}
 		if (nbusy) {
 			/*


This just stops it from giving up if it had recently made any progress.

I tried it quickly on here, and it seemed to work, but I don't know the 
ramifications for my actions. :)


Kevin

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802170810.CAA01127>