Module Name:    src
Committed By:   hannken
Date:           Tue Oct 13 13:15:39 UTC 2020

Modified Files:
        src/sys/kern: vfs_mount.c

Log Message:
Suspend file system before unmounting in mount_domount() error path
to prevent diagnostic assertions from unmount/flush.

Reported-by: [email protected]
Reported-by: [email protected]
Reported-by: [email protected]
Reported-by: [email protected]
Reported-by: [email protected]


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/kern/vfs_mount.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/kern/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.83 src/sys/kern/vfs_mount.c:1.84
--- src/sys/kern/vfs_mount.c:1.83	Sat May 23 23:42:43 2020
+++ src/sys/kern/vfs_mount.c	Tue Oct 13 13:15:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.83 2020/05/23 23:42:43 ad Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.84 2020/10/13 13:15:39 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.83 2020/05/23 23:42:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.84 2020/10/13 13:15:39 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -832,8 +832,11 @@ mount_domount(struct lwp *l, vnode_t **v
 	return error;
 
 err_mounted:
+	if (vfs_suspend(mp, 0))
+		panic("Suspending fresh file system failed");
 	if (VFS_UNMOUNT(mp, MNT_FORCE) != 0)
 		panic("Unmounting fresh file system failed");
+	vfs_resume(mp);
 
 err_unmounted:
 	vp->v_mountedhere = NULL;

Reply via email to