Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/union Print the warning message on mount once.



details:   https://anonhg.NetBSD.org/src/rev/3ea6ddf0d59f
branches:  trunk
changeset: 768869:3ea6ddf0d59f
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun Aug 28 08:27:57 2011 +0000

description:
Print the warning message on mount once.

Should fix PR #42795 (patch to make mounting union filesystems less obnoxious)

diffstat:

 sys/fs/union/union_vfsops.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r b1dd21412b87 -r 3ea6ddf0d59f sys/fs/union/union_vfsops.c
--- a/sys/fs/union/union_vfsops.c       Sun Aug 28 08:24:42 2011 +0000
+++ b/sys/fs/union/union_vfsops.c       Sun Aug 28 08:27:57 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: union_vfsops.c,v 1.63 2010/07/05 21:27:08 pooka Exp $  */
+/*     $NetBSD: union_vfsops.c,v 1.64 2011/08/28 08:27:57 hannken Exp $        */
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.63 2010/07/05 21:27:08 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.64 2011/08/28 08:27:57 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -101,6 +101,9 @@
 VFS_PROTOS(union);
 
 static struct sysctllog *union_sysctl_log;
+static const char *warn_user =
+    "WARNING: the union file system is experimental\n"
+    "WARNING: it can cause crashes and file system corruption\n";
 
 /*
  * Mount union filesystem
@@ -148,8 +151,10 @@
                goto bad;
        }
 
-       printf("WARNING: the union file system is experimental\n"
-           "WARNING: it can cause crashes and file system corruption\n");
+       if (warn_user != NULL) {
+               printf("%s", warn_user);
+               warn_user = NULL;
+       }
 
        lowerrootvp = mp->mnt_vnodecovered;
        vref(lowerrootvp);



Home | Main Index | Thread Index | Old Index