Module Name:    src
Committed By:   martin
Date:           Mon Feb  6 16:57:24 UTC 2023

Modified Files:
        src/sys/fs/union [netbsd-10]: union_vfsops.c
        src/sys/miscfs/nullfs [netbsd-10]: null_vfsops.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #68):

        sys/fs/union/union_vfsops.c: revision 1.86
        sys/miscfs/nullfs/null_vfsops.c: revision 1.101

Set IMNT_MPSAFE only if all lower layers have it set.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.85.2.1 src/sys/fs/union/union_vfsops.c
cvs rdiff -u -r1.100 -r1.100.2.1 src/sys/miscfs/nullfs/null_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.85 src/sys/fs/union/union_vfsops.c:1.85.2.1
--- src/sys/fs/union/union_vfsops.c:1.85	Mon Nov 21 10:37:14 2022
+++ src/sys/fs/union/union_vfsops.c	Mon Feb  6 16:57:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vfsops.c,v 1.85 2022/11/21 10:37:14 hannken Exp $	*/
+/*	$NetBSD: union_vfsops.c,v 1.85.2.1 2023/02/06 16:57:24 martin 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.85 2022/11/21 10:37:14 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.85.2.1 2023/02/06 16:57:24 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -198,7 +198,14 @@ union_mount(struct mount *mp, const char
 		goto bad;
 	}
 
-	mp->mnt_iflag |= IMNT_MPSAFE;
+	/*
+	 * This mount is mp-safe if both lower mounts are mp-safe.
+	 */
+
+	if (((um->um_lowervp == NULLVP) ||
+	    (um->um_lowervp->v_mount->mnt_iflag & IMNT_MPSAFE)) &&
+	    (um->um_uppervp->v_mount->mnt_iflag & IMNT_MPSAFE))
+		mp->mnt_iflag |= IMNT_MPSAFE;
 
 	/*
 	 * Unless the mount is readonly, ensure that the top layer

Index: src/sys/miscfs/nullfs/null_vfsops.c
diff -u src/sys/miscfs/nullfs/null_vfsops.c:1.100 src/sys/miscfs/nullfs/null_vfsops.c:1.100.2.1
--- src/sys/miscfs/nullfs/null_vfsops.c:1.100	Fri Nov  4 11:20:39 2022
+++ src/sys/miscfs/nullfs/null_vfsops.c	Mon Feb  6 16:57:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: null_vfsops.c,v 1.100 2022/11/04 11:20:39 hannken Exp $	*/
+/*	$NetBSD: null_vfsops.c,v 1.100.2.1 2023/02/06 16:57:24 martin Exp $	*/
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.100 2022/11/04 11:20:39 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.100.2.1 2023/02/06 16:57:24 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -138,7 +138,7 @@ nullfs_mount(struct mount *mp, const cha
 	/* Create the mount point. */
 	nmp = kmem_zalloc(sizeof(struct null_mount), KM_SLEEP);
 	mp->mnt_data = nmp;
-	mp->mnt_iflag |= IMNT_MPSAFE;
+	mp->mnt_iflag |= lowerrootvp->v_mount->mnt_iflag & IMNT_MPSAFE;
 	mp->mnt_iflag |= lowerrootvp->v_mount->mnt_iflag & IMNT_SHRLOOKUP;
 
 	/*

Reply via email to