diff options
| author | hannken <hannken@NetBSD.org> | 2023-02-06 10:33:32 +0000 |
|---|---|---|
| committer | hannken <hannken@NetBSD.org> | 2023-02-06 10:33:32 +0000 |
| commit | 290e5e4a24e6743f8e0c7c853bdc18a3ad45b449 (patch) | |
| tree | 39f3e0fe504ee893734cbd7c497751205779b230 /sys/fs | |
| parent | 1d823d1f3bd19ca9dfafaa6de723f21086642551 (diff) | |
Set IMNT_MPSAFE only if all lower layers have it set.
Diffstat (limited to 'sys/fs')
| -rw-r--r-- | sys/fs/union/union_vfsops.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/fs/union/union_vfsops.c b/sys/fs/union/union_vfsops.c index 3a5068efd47..77b0d211efe 100644 --- a/sys/fs/union/union_vfsops.c +++ b/sys/fs/union/union_vfsops.c @@ -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 *path, void *data, size_t *data_len) 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 |
