From owner-svn-src-all@freebsd.org Thu Nov 7 15:33:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB13C1B7CA2; Thu, 7 Nov 2019 15:33:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4786qJ5vtXz3Lf5; Thu, 7 Nov 2019 15:33:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE2EBFDEB; Thu, 7 Nov 2019 15:33:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7FX0kD068466; Thu, 7 Nov 2019 15:33:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7FX0cP068464; Thu, 7 Nov 2019 15:33:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911071533.xA7FX0cP068464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 7 Nov 2019 15:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354444 - in stable/12/sys: cddl/contrib/opensolaris/uts/common/fs/zfs sys vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: cddl/contrib/opensolaris/uts/common/fs/zfs sys vm X-SVN-Commit-Revision: 354444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 15:33:01 -0000 Author: kib Date: Thu Nov 7 15:32:59 2019 New Revision: 354444 URL: https://svnweb.freebsd.org/changeset/base/354444 Log: MFC r353892: Assert that vnode_pager_setsize() is called with the vnode exclusively locked. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/12/sys/sys/mount.h stable/12/sys/vm/vnode_pager.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Nov 7 15:00:37 2019 (r354443) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Nov 7 15:32:59 2019 (r354444) @@ -1400,6 +1400,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED; vfsp->mnt_kern_flag |= MNTK_NO_IOPF; /* vn_io_fault can be used */ + vfsp->mnt_kern_flag |= MNTK_VMSETSIZE_BUG; /* * The fsid is 64 bits, composed of an 8-bit fs type, which Modified: stable/12/sys/sys/mount.h ============================================================================== --- stable/12/sys/sys/mount.h Thu Nov 7 15:00:37 2019 (r354443) +++ stable/12/sys/sys/mount.h Thu Nov 7 15:32:59 2019 (r354444) @@ -396,6 +396,7 @@ void __mnt_vnode_markerfree_active(struct vno #define MNTK_UNMAPPED_BUFS 0x00002000 #define MNTK_USES_BCACHE 0x00004000 /* FS uses the buffer cache. */ #define MNTK_TEXT_REFS 0x00008000 /* Keep use ref for text */ +#define MNTK_VMSETSIZE_BUG 0x00010000 #define MNTK_NOASYNC 0x00800000 /* disable async */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ Modified: stable/12/sys/vm/vnode_pager.c ============================================================================== --- stable/12/sys/vm/vnode_pager.c Thu Nov 7 15:00:37 2019 (r354443) +++ stable/12/sys/vm/vnode_pager.c Thu Nov 7 15:32:59 2019 (r354444) @@ -433,7 +433,16 @@ vnode_pager_setsize(struct vnode *vp, vm_ooffset_t nsi if ((object = vp->v_object) == NULL) return; -/* ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); */ +#ifdef DEBUG_VFS_LOCKS + { + struct mount *mp; + + mp = vp->v_mount; + if (mp != NULL && (mp->mnt_kern_flag & MNTK_VMSETSIZE_BUG) == 0) + assert_vop_elocked(vp, + "vnode_pager_setsize and not locked vnode"); + } +#endif VM_OBJECT_WLOCK(object); if (object->type == OBJT_DEAD) { VM_OBJECT_WUNLOCK(object);