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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to