Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/mount In case we are union-mounting /, don't force MNT_...



details:   https://anonhg.NetBSD.org/src/rev/7ed6a0797e99
branches:  trunk
changeset: 760808:7ed6a0797e99
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Jan 13 11:57:02 2011 +0000

description:
In case we are union-mounting /, don't force MNT_UPDATE.  This makes
the following work:

        mount -t tmpfs -o union tmpfs /

(some caveats are implied, such as if you "mkdir /usr" you're
screwed, but then again you'll get there with "rm -rf /usr" even
without union -- we supply rope)

per discussion with zafer, use case for jibbed

diffstat:

 sbin/mount/mount.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r ecaa291c4047 -r 7ed6a0797e99 sbin/mount/mount.c
--- a/sbin/mount/mount.c        Thu Jan 13 11:00:19 2011 +0000
+++ b/sbin/mount/mount.c        Thu Jan 13 11:57:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mount.c,v 1.91 2010/01/14 21:46:24 pooka Exp $ */
+/*     $NetBSD: mount.c,v 1.92 2011/01/13 11:57:02 pooka Exp $ */
 
 /*
  * Copyright (c) 1980, 1989, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)mount.c    8.25 (Berkeley) 5/8/95";
 #else
-__RCSID("$NetBSD: mount.c,v 1.91 2010/01/14 21:46:24 pooka Exp $");
+__RCSID("$NetBSD: mount.c,v 1.92 2011/01/13 11:57:02 pooka Exp $");
 #endif
 #endif /* not lint */
 
@@ -392,7 +392,7 @@
        if (!mntopts && !options)
                catopt(&optbuf, "rw");
 
-       if (getargs == 0 && strcmp(name, "/") == 0)
+       if (getargs == 0 && strcmp(name, "/") == 0 && !hasopt(optbuf, "union"))
                flags |= MNT_UPDATE;
        else if (skipmounted) {
                if ((numfs = getmntinfo(&sfp, MNT_WAIT)) == 0) {



Home | Main Index | Thread Index | Old Index