From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 7 23:26:29 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3302F106566B; Thu, 7 Jul 2011 23:26:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18E9E8FC12; Thu, 7 Jul 2011 23:26:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p67NQSDn083124; Thu, 7 Jul 2011 23:26:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p67NQSF4083121; Thu, 7 Jul 2011 23:26:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107072326.p67NQSF4083121@svn.freebsd.org> From: Xin LI Date: Thu, 7 Jul 2011 23:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223850 - in stable/8: sbin/mount share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 23:26:29 -0000 Author: delphij Date: Thu Jul 7 23:26:28 2011 New Revision: 223850 URL: http://svn.freebsd.org/changeset/base/223850 Log: MFC r222832: Add a special mount option "failok" to indicate that the administrator wants the system to proceed to boot without bailing out into single user mode, even when the file system can not be successfully mounted. This option is implemented in mount(8) and not passed into kernel. Modified: stable/8/sbin/mount/mount.c stable/8/share/man/man5/fstab.5 Directory Properties: stable/8/sbin/mount/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/sbin/mount/mount.c ============================================================================== --- stable/8/sbin/mount/mount.c Thu Jul 7 23:17:56 2011 (r223849) +++ stable/8/sbin/mount/mount.c Thu Jul 7 23:26:28 2011 (r223850) @@ -243,7 +243,7 @@ main(int argc, char *argv[]) const char *mntfromname, **vfslist, *vfstype; struct fstab *fs; struct statfs *mntbuf; - int all, ch, i, init_flags, late, mntsize, rval, have_fstab, ro; + int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro; char *cp, *ep, *options; all = init_flags = late = 0; @@ -328,6 +328,10 @@ main(int argc, char *argv[]) continue; if (hasopt(fs->fs_mntops, "late") && !late) continue; + if (hasopt(fs->fs_mntops, "failok")) + failok = 1; + else + failok = 0; if (!(init_flags & MNT_UPDATE) && ismounted(fs, mntbuf, mntsize)) continue; @@ -335,7 +339,7 @@ main(int argc, char *argv[]) mntbuf->f_flags); if (mountfs(fs->fs_vfstype, fs->fs_spec, fs->fs_file, init_flags, options, - fs->fs_mntops)) + fs->fs_mntops) && !failok) rval = 1; } } else if (fstab_style) { @@ -717,6 +721,14 @@ mangle(char *options, struct cpa *a) * before mountd starts. */ continue; + } else if (strcmp(p, "failok") == 0) { + /* + * "failok" is used to prevent certain file + * systems from being causing the system to + * drop into single user mode in the boot + * cycle, and is not a real mount option. + */ + continue; } else if (strncmp(p, "mountprog", 9) == 0) { /* * "mountprog" is used to force the use of Modified: stable/8/share/man/man5/fstab.5 ============================================================================== --- stable/8/share/man/man5/fstab.5 Thu Jul 7 23:17:56 2011 (r223849) +++ stable/8/share/man/man5/fstab.5 Thu Jul 7 23:26:28 2011 (r223850) @@ -32,7 +32,7 @@ .\" @(#)fstab.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 23, 2008 +.Dd June 7, 2011 .Dt FSTAB 5 .Os .Sh NAME @@ -147,6 +147,13 @@ this location can be specified as: userquota=/var/quotas/tmp.user .Ed .Pp +If the option ``failok'' is specified, +the system will ignore any error which happens during the mount of that filesystem, +which would otherwise cause the system to drop into single user mode. +This option is implemented by the +.Xr mount 8 +command and will not be passed to the kernel. +.Pp If the option ``noauto'' is specified, the file system will not be automatically mounted at system startup. Note that, for network file systems