Module Name:    src
Committed By:   hannken
Date:           Wed Feb 20 10:06:00 UTC 2019

Modified Files:
        src/sys/fs/union: union_vfsops.c
        src/sys/miscfs/nullfs: null_vfsops.c
        src/sys/miscfs/overlay: overlay_vfsops.c
        src/sys/miscfs/umapfs: umap_vfsops.c

Log Message:
Set "mnt_lower" before the first file system operation on the new file system.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/fs/union/union_vfsops.c
cvs rdiff -u -r1.94 -r1.95 src/sys/miscfs/nullfs/null_vfsops.c
cvs rdiff -u -r1.67 -r1.68 src/sys/miscfs/overlay/overlay_vfsops.c
cvs rdiff -u -r1.99 -r1.100 src/sys/miscfs/umapfs/umap_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.78 src/sys/fs/union/union_vfsops.c:1.79
--- src/sys/fs/union/union_vfsops.c:1.78	Sat Apr  1 19:35:56 2017
+++ src/sys/fs/union/union_vfsops.c	Wed Feb 20 10:05:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vfsops.c,v 1.78 2017/04/01 19:35:56 riastradh Exp $	*/
+/*	$NetBSD: union_vfsops.c,v 1.79 2019/02/20 10:05:59 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.78 2017/04/01 19:35:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.79 2019/02/20 10:05:59 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -246,14 +246,13 @@ union_mount(struct mount *mp, const char
 
 	mp->mnt_data = um;
 	vfs_getnewfsid(mp);
+	mp->mnt_lower = um->um_uppervp->v_mount;
 
 	error = set_statvfs_info( path, UIO_USERSPACE, NULL, UIO_USERSPACE,
 	    mp->mnt_op->vfs_name, mp, l);
 	if (error)
 		goto bad;
 
-	mp->mnt_lower = um->um_uppervp->v_mount;
-
 	switch (um->um_op) {
 	case UNMNT_ABOVE:
 		cp = "<above>:";

Index: src/sys/miscfs/nullfs/null_vfsops.c
diff -u src/sys/miscfs/nullfs/null_vfsops.c:1.94 src/sys/miscfs/nullfs/null_vfsops.c:1.95
--- src/sys/miscfs/nullfs/null_vfsops.c:1.94	Tue Apr 11 07:51:37 2017
+++ src/sys/miscfs/nullfs/null_vfsops.c	Wed Feb 20 10:06:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: null_vfsops.c,v 1.94 2017/04/11 07:51:37 hannken Exp $	*/
+/*	$NetBSD: null_vfsops.c,v 1.95 2019/02/20 10:06:00 hannken 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.94 2017/04/11 07:51:37 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.95 2019/02/20 10:06:00 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -146,6 +146,7 @@ nullfs_mount(struct mount *mp, const cha
 	 * that the node create call will work.
 	 */
 	vfs_getnewfsid(mp);
+	mp->mnt_lower = lowerrootvp->v_mount;
 
 	nmp->nullm_size = sizeof(struct null_node);
 	nmp->nullm_tag = VT_NULL;
@@ -175,7 +176,6 @@ nullfs_mount(struct mount *mp, const cha
 	if (error)
 		return error;
 
-	mp->mnt_lower = lowerrootvp->v_mount;
 	if (mp->mnt_lower->mnt_flag & MNT_LOCAL)
 		mp->mnt_flag |= MNT_LOCAL;
 	return 0;

Index: src/sys/miscfs/overlay/overlay_vfsops.c
diff -u src/sys/miscfs/overlay/overlay_vfsops.c:1.67 src/sys/miscfs/overlay/overlay_vfsops.c:1.68
--- src/sys/miscfs/overlay/overlay_vfsops.c:1.67	Tue Apr 11 07:51:37 2017
+++ src/sys/miscfs/overlay/overlay_vfsops.c	Wed Feb 20 10:06:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: overlay_vfsops.c,v 1.67 2017/04/11 07:51:37 hannken Exp $	*/
+/*	$NetBSD: overlay_vfsops.c,v 1.68 2019/02/20 10:06:00 hannken Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 National Aeronautics & Space Administration
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.67 2017/04/11 07:51:37 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.68 2019/02/20 10:06:00 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -155,6 +155,7 @@ ov_mount(struct mount *mp, const char *p
 	 * that the node create call will work.
 	 */
 	vfs_getnewfsid(mp);
+	mp->mnt_lower = lowerrootvp->v_mount;
 
 	nmp->ovm_size = sizeof (struct overlay_node);
 	nmp->ovm_tag = VT_OVERLAY;
@@ -189,7 +190,6 @@ ov_mount(struct mount *mp, const char *p
 	if (error)
 		return error;
 
-	mp->mnt_lower = lowerrootvp->v_mount;
 	if (mp->mnt_lower->mnt_flag & MNT_LOCAL)
 		mp->mnt_flag |= MNT_LOCAL;
 #ifdef OVERLAYFS_DIAGNOSTIC

Index: src/sys/miscfs/umapfs/umap_vfsops.c
diff -u src/sys/miscfs/umapfs/umap_vfsops.c:1.99 src/sys/miscfs/umapfs/umap_vfsops.c:1.100
--- src/sys/miscfs/umapfs/umap_vfsops.c:1.99	Tue Apr 11 07:51:37 2017
+++ src/sys/miscfs/umapfs/umap_vfsops.c	Wed Feb 20 10:06:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: umap_vfsops.c,v 1.99 2017/04/11 07:51:37 hannken Exp $	*/
+/*	$NetBSD: umap_vfsops.c,v 1.100 2019/02/20 10:06:00 hannken Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umap_vfsops.c,v 1.99 2017/04/11 07:51:37 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umap_vfsops.c,v 1.100 2019/02/20 10:06:00 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -191,6 +191,8 @@ umapfs_mount(struct mount *mp, const cha
 	 * that the node create call will work.
 	 */
 	vfs_getnewfsid(mp);
+	mp->mnt_lower = lowerrootvp->v_mount;
+
 	amp->umapm_size = sizeof(struct umap_node);
 	amp->umapm_tag = VT_UMAP;
 	amp->umapm_bypass = umap_bypass;
@@ -224,7 +226,6 @@ umapfs_mount(struct mount *mp, const cha
 	if (error)
 		return error;
 
-	mp->mnt_lower = lowerrootvp->v_mount;
 	if (mp->mnt_lower->mnt_flag & MNT_LOCAL)
 		mp->mnt_flag |= MNT_LOCAL;
 #ifdef UMAPFS_DIAGNOSTIC

Reply via email to