From owner-freebsd-bugs Tue Feb 17 00:20:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA02776 for freebsd-bugs-outgoing; Tue, 17 Feb 1998 00:20:04 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA02755; Tue, 17 Feb 1998 00:20:02 -0800 (PST) (envelope-from gnats) Received: from shell.dragondata.com (root@shell.dragondata.com [204.137.237.8]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA01047 for ; Tue, 17 Feb 1998 00:10:09 -0800 (PST) (envelope-from root@shell.dragondata.com) Received: (from root@localhost) by shell.dragondata.com (8.8.8/8.8.7) id CAA01127; Tue, 17 Feb 1998 02:10:09 -0600 (CST) (envelope-from root) Message-Id: <199802170810.CAA01127@shell.dragondata.com> Date: Tue, 17 Feb 1998 02:10:09 -0600 (CST) From: toasty@dragondata.com Reply-To: toasty@dragondata.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/5768: Shutdown aborts syncing, when sync isn't done. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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