From owner-svn-src-all@FreeBSD.ORG Sat May 4 14:00:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7A8DDA3; Sat, 4 May 2013 14:00:17 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 81D151C3E; Sat, 4 May 2013 14:00:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44E0Hs0093601; Sat, 4 May 2013 14:00:17 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44E0GvD093597; Sat, 4 May 2013 14:00:16 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201305041400.r44E0GvD093597@svn.freebsd.org> From: Chris Rees Date: Sat, 4 May 2013 14:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250235 - in head: etc/rc.d sbin/mount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:00:17 -0000 Author: crees (ports committer) Date: Sat May 4 14:00:16 2013 New Revision: 250235 URL: http://svnweb.freebsd.org/changeset/base/250235 Log: Introduce and use new flag -L to mount for mounting only late filesystems. Previously, rc.d/mountlate mounted *all* filesystems, causing problems with background NFS mounts being mounted twice. PR: conf/137629 Submitted by: eadler (original concept) Reviewed by: mjg Approved by: hrs Modified: head/etc/rc.d/mountlate head/sbin/mount/mount.8 head/sbin/mount/mount.c Modified: head/etc/rc.d/mountlate ============================================================================== --- head/etc/rc.d/mountlate Sat May 4 12:57:21 2013 (r250234) +++ head/etc/rc.d/mountlate Sat May 4 14:00:16 2013 (r250235) @@ -21,19 +21,10 @@ mountlate_start() # Mount "late" filesystems. # err=0 - latefs= - # / (root) fs is always remounted, so remove from list - latefs="`/sbin/mount -d -a -l | grep -v ' /$'`" - case ${latefs} in - '') - ;; - *) - echo -n 'Mounting late file systems:' - mount -a -l - err=$? - echo '.' - ;; - esac + echo -n 'Mounting late file systems:' + mount -a -L + err=$? + echo '.' case ${err} in 0) Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Sat May 4 12:57:21 2013 (r250234) +++ head/sbin/mount/mount.8 Sat May 4 14:00:16 2013 (r250235) @@ -106,6 +106,13 @@ a file system mount status from read-wri Also forces the R/W mount of an unclean file system (dangerous; use with caution). +.It Fl L +When used in conjunction with the +.Fl a +option, mount +.Em only +those file systems which are marked as +.Dq Li late . .It Fl l When used in conjunction with the .Fl a Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Sat May 4 12:57:21 2013 (r250234) +++ head/sbin/mount/mount.c Sat May 4 14:00:16 2013 (r250235) @@ -245,14 +245,15 @@ main(int argc, char *argv[]) struct fstab *fs; struct statfs *mntbuf; int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro; + int onlylate; char *cp, *ep, *options; - all = init_flags = late = 0; + all = init_flags = late = onlylate = 0; ro = 0; options = NULL; vfslist = NULL; vfstype = "ufs"; - while ((ch = getopt(argc, argv, "adF:flo:prt:uvw")) != -1) + while ((ch = getopt(argc, argv, "adF:fLlo:prt:uvw")) != -1) switch (ch) { case 'a': all = 1; @@ -266,6 +267,10 @@ main(int argc, char *argv[]) case 'f': init_flags |= MNT_FORCE; break; + case 'L': + onlylate = 1; + late = 1; + break; case 'l': late = 1; break; @@ -327,6 +332,8 @@ main(int argc, char *argv[]) continue; if (hasopt(fs->fs_mntops, "noauto")) continue; + if (!hasopt(fs->fs_mntops, "late") && onlylate) + continue; if (hasopt(fs->fs_mntops, "late") && !late) continue; if (hasopt(fs->fs_mntops, "failok"))