Date: Sun, 22 Mar 2020 18:18:30 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359219 - head/sys/kern Message-ID: <202003221818.02MIIUY1074276@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sun Mar 22 18:18:30 2020 New Revision: 359219 URL: https://svnweb.freebsd.org/changeset/base/359219 Log: Fix an NFS mount attempt where VFS_STATFS() fails. r353150 added mnt_rootvnode and this seems to have broken NFS mounts when the VFS_STATFS() called just after VFS_MOUNT() returns an error. Then the code calls VFS_UNMOUNT(), which calls vflush(), which returns EBUSY. Then the thread get stuck sleeping on "mntref" in vfs_mount_destroy(). This patch fixes this problem. Reviewed by: kib, mjg Differential Revision: https://reviews.freebsd.org/D24022 Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Mar 22 17:59:36 2020 (r359218) +++ head/sys/kern/vfs_mount.c Sun Mar 22 18:18:30 2020 (r359219) @@ -900,7 +900,7 @@ vfs_domount_first( { struct vattr va; struct mount *mp; - struct vnode *newdp; + struct vnode *newdp, *rootvp; int error, error1; ASSERT_VOP_ELOCKED(vp, __func__); @@ -967,6 +967,9 @@ vfs_domount_first( (error1 = VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) != 0) { if (error1 != 0) { error = error1; + rootvp = vfs_cache_root_clear(mp); + if (rootvp != NULL) + vrele(rootvp); if ((error1 = VFS_UNMOUNT(mp, 0)) != 0) printf("VFS_UNMOUNT returned %d\n", error1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003221818.02MIIUY1074276>