Date: Thu, 22 Jul 2004 19:08:06 +1000 From: Peter Jeremy <PeterJeremy@optushome.com.au> To: Robert Watson <rwatson@freebsd.org> Cc: current@freebsd.org Subject: Re: Anyone else noticed: bgfsck doesn't bgfsck non-root 'a' partitions? Message-ID: <20040722090806.GF3001@cirb503493.alcatel.com.au> In-Reply-To: <Pine.NEB.3.96L.1040720155203.98217H-100000@fledge.watson.org> References: <Pine.NEB.3.96L.1040720155203.98217H-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040722090806.GF3001>