Module Name:    src
Committed By:   hannken
Date:           Mon Feb  6 10:33:32 UTC 2023

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

Log Message:
Set IMNT_MPSAFE only if all lower layers have it set.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 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.85 src/sys/fs/union/union_vfsops.c:1.86
--- 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 10:33:32 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.86 2023/02/06 10:33:32 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.85 2022/11/21 10:37:14 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.86 2023/02/06 10:33:32 hannken 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

Reply via email to