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

This commit is contained in:
hannken 2019-02-20 10:05:59 +00:00
parent 3c4b857dd5
commit 2df7877a09
4 changed files with 13 additions and 13 deletions

View File

@ -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 *path, void *data, size_t *data_len)
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>:";

View File

@ -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 char *path, void *data, size_t *data_len)
* 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 char *path, void *data, size_t *data_len)
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;

View File

@ -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 *path, void *data, size_t *data_len)
* 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 *path, void *data, size_t *data_len)
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

View File

@ -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 char *path, void *data, size_t *data_len)
* 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 char *path, void *data, size_t *data_len)
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