From owner-freebsd-current Mon Jan 27 15:28:37 2003 Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id D472937B401; Mon, 27 Jan 2003 15:28:34 -0800 (PST) Date: Mon, 27 Jan 2003 15:28:34 -0800 From: Juli Mallett To: current@FreeBSD.org Cc: tds@dmnstech.net Subject: Diff to make fsck(8) ignore certain filesystems. Message-ID: <20030127152834.A5410@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Organisation: The FreeBSD Project X-Alternate-Addresses: , , , , X-Towel: Yes X-LiveJournal: flata, jmallett X-Negacore: Yes Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This prevents fsck from failing at boot if there are nullfs or unionfs filesystems in fstab(5), as reported by tds@dmnstech.net. Anyone mind if I commit this? (Or have suggestions for filesystems to add to the list?) %%% Index: fsck.c =================================================================== RCS file: /home/ncvs/src/sbin/fsck/fsck.c,v retrieving revision 1.12 diff -d -u -r1.12 fsck.c --- fsck.c 31 Oct 2002 15:32:39 -0000 1.12 +++ fsck.c 27 Jan 2003 23:24:51 -0000 @@ -79,6 +79,8 @@ static int flags = 0; static int forceflag = 0; +static const char *nofsck[] = { "nullfs", "unionfs", NULL }; + static int checkfs(const char *, const char *, const char *, char *, pid_t *); static int selected(const char *); static void addoption(char *); @@ -90,6 +92,7 @@ static const char *getfslab(const char *); static void usage(void) __dead2; static int isok(struct fstab *); +static int skip(const char *); int main(int argc, char *argv[]) @@ -209,6 +212,10 @@ errx(1, "%s has unknown file system type.", spec); } + if (skip(type)) { + printf("%s: FILESYSTEM DOES NOT SUPPORT FSCK\n", *argv); + continue; + } if ((flags & CHECK_BACKGRD) && checkfs(type, spec, mntpt, "-F", NULL) == 0) { printf("%s: DEFER FOR BACKGROUND CHECKING\n", *argv); @@ -577,6 +584,17 @@ return vfstype; } +static int +skip(const char *fstype) +{ + const char *p; + + for (p = nofsck[0]; p != NULL; p++) { + if (strcmp(p, fstype) == 0) + return 1; + } + return 0; +} static void usage(void) %%% Thanx, juli. -- Juli Mallett AIM: BSDFlata -- IRC: juli on EFnet. OpenDarwin, Mono, FreeBSD Developer. ircd-hybrid Developer, EFnet addict. FreeBSD on MIPS-Anything on FreeBSD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message