From owner-freebsd-current@FreeBSD.ORG Thu Jul 22 09:08:12 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 74CF016A4CE; Thu, 22 Jul 2004 09:08:12 +0000 (GMT) Received: from mail013.syd.optusnet.com.au (mail013.syd.optusnet.com.au [211.29.132.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2022A43D3F; Thu, 22 Jul 2004 09:08:11 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) i6M988F18369; Thu, 22 Jul 2004 19:08:09 +1000 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])i6M987Vd009392; Thu, 22 Jul 2004 19:08:07 +1000 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost)i6M986Lj009391; Thu, 22 Jul 2004 19:08:06 +1000 (EST) (envelope-from pjeremy) Date: Thu, 22 Jul 2004 19:08:06 +1000 From: Peter Jeremy To: Robert Watson Message-ID: <20040722090806.GF3001@cirb503493.alcatel.com.au> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i cc: current@freebsd.org Subject: Re: Anyone else noticed: bgfsck doesn't bgfsck non-root 'a' partitions? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2004 09:08:12 -0000 On Tue, 2004-Jul-20 15:55:17 -0400, Robert Watson wrote: >fsck has logic to force a full preening fsck of '/', permitting background >file system fsck only for non-root file systems. ... >on /var and /usr, but not /local0. So it sounds like the logic in fsck is >simply guessing that any 'a' partition needs a foreground fsck. I can't quickly find that logic anywhere. The logic I can find is: * "ro" and "noauto" filesystems aren't eligible for background fsck (fsck.c:isok()) * Previous background fsck failed or filesystem doesn't have soft-updates enabled or kernel doesn't have soft-updates support or filesystem already clean forces a foreground fsck ("fsck_ufs -F" from fsck.c:checkfs()). Are you sure /local0 doesn't fall into one of the above categories? The following (untested) patch disables background checking for pass 1 filesystems when fsck is running in "scan fstab" mode. According to fstab(5), only the root filesystem should be in pass 1. Index: fsck.c =================================================================== RCS file: /usr/ncvs/src/sbin/fsck/fsck.c,v retrieving revision 1.17 diff -u -r1.17 fsck.c --- fsck.c 29 Oct 2003 16:09:17 -0000 1.17 +++ fsck.c 22 Jul 2004 08:46:33 -0000 @@ -244,6 +244,8 @@ * by invoking its check program with the -F flag. */ if (flags & DO_BACKGRD) { + if (fs->fs_passno == 1) + return (0); if (!strcmp(fs->fs_type, FSTAB_RO)) return (0); if (getmntpt(fs->fs_spec) == NULL) @@ -261,7 +263,8 @@ * itself to see if it is willing to defer to background * checking by invoking its check program with the -F flag. */ - if ((flags & CHECK_BACKGRD) == 0 || !strcmp(fs->fs_type, FSTAB_RO)) + if ((flags & CHECK_BACKGRD) == 0 || !strcmp(fs->fs_type, FSTAB_RO) || + fs->fs_passno == 1) return (1); for (i = strlen(fs->fs_mntops) - 6; i >= 0; i--) if (!strncmp(&fs->fs_mntops[i], "noauto", 6)) -- Peter Jeremy