cvs commit: src/sys/kern kern_shutdown.c vfs_subr.c

Don Lewis truckman at FreeBSD.org
Tue Aug 10 01:32:58 PDT 2004


On 10 Aug, Nate Lawson wrote:
> njl         2004-08-10 01:32:05 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/kern             kern_shutdown.c vfs_subr.c 
>   Log:
>   Skip the syncing disks loop if there are no dirty buffers.  Remove a
>   variable used to flag the initial printf.
>   
>   Submitted by:   truckman (earlier version)
>   
>   Revision  Changes    Path
>   1.162     +13 -5     src/sys/kern/kern_shutdown.c
>   1.519     +1 -1      src/sys/kern/vfs_subr.c

BDE had a number of objections to this patch.  This is the alternative
that I came up with:

Index: kern_shutdown.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_shutdown.c,v
retrieving revision 1.161
diff -u -r1.161 kern_shutdown.c
--- kern_shutdown.c	30 Jul 2004 01:30:05 -0000	1.161
+++ kern_shutdown.c	31 Jul 2004 06:40:59 -0000
@@ -303,8 +303,11 @@
 					nbusy++;
 				}
 			}
-			if (nbusy == 0)
+			if (nbusy == 0) {
+				if (first_buf_printf)
+					printf("no buffers busy");
 				break;
+			}
 			if (first_buf_printf) {
 				printf("syncing disks, buffers remaining... ");
 				first_buf_printf = 0;
@@ -338,7 +341,7 @@
 			PICKUP_GIANT();
 #endif
 		}
-
+		printf("\n");
 		/*
 		 * Count only busy local buffers to prevent forcing 
 		 * a fsck if we're just a client of a wedged NFS server
@@ -370,6 +373,7 @@
 			printf("giving up on %d buffers\n", nbusy);
 			DELAY(5000000);	/* 5 seconds */
 		} else {
+			printf("final sync complete\n");
 			/*
 			 * Unmount filesystems
 			 */



More information about the cvs-src mailing list