Module Name:    src
Committed By:   hannken
Date:           Sun Aug 28 08:27:57 UTC 2011

Modified Files:
        src/sys/fs/union: union_vfsops.c

Log Message:
Print the warning message on mount once.

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


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/fs/union/union_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/union/union_vfsops.c
diff -u src/sys/fs/union/union_vfsops.c:1.63 src/sys/fs/union/union_vfsops.c:1.64
--- src/sys/fs/union/union_vfsops.c:1.63	Mon Jul  5 21:27:08 2010
+++ src/sys/fs/union/union_vfsops.c	Sun Aug 28 08:27:57 2011
@@ -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);

Reply via email to