From owner-svn-src-stable-11@freebsd.org Sun Sep 3 09:09:30 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45199E013CB; Sun, 3 Sep 2017 09:09:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1261663A01; Sun, 3 Sep 2017 09:09:30 +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 v8399TSv093916; Sun, 3 Sep 2017 09:09:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8399TbY093914; Sun, 3 Sep 2017 09:09:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709030909.v8399TbY093914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 3 Sep 2017 09:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r323141 - in stable/11/sys: kern sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: kern sys X-SVN-Commit-Revision: 323141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Sep 2017 09:09:30 -0000 Author: kib Date: Sun Sep 3 09:09:28 2017 New Revision: 323141 URL: https://svnweb.freebsd.org/changeset/base/323141 Log: MFC r322721: Allow vinvalbuf() to operate with the shared vnode lock. Modified: stable/11/sys/kern/vfs_subr.c stable/11/sys/sys/vnode.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Sun Sep 3 09:05:48 2017 (r323140) +++ stable/11/sys/kern/vfs_subr.c Sun Sep 3 09:09:28 2017 (r323141) @@ -1628,9 +1628,13 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int slpf #ifdef INVARIANTS BO_LOCK(bo); - if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO)) == 0 && - (bo->bo_dirty.bv_cnt > 0 || bo->bo_clean.bv_cnt > 0)) + if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO | + V_ALLOWCLEAN)) == 0 && (bo->bo_dirty.bv_cnt > 0 || + bo->bo_clean.bv_cnt > 0)) panic("vinvalbuf: flush failed"); + if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO)) == 0 && + bo->bo_dirty.bv_cnt > 0) + panic("vinvalbuf: flush dirty failed"); BO_UNLOCK(bo); #endif return (0); Modified: stable/11/sys/sys/vnode.h ============================================================================== --- stable/11/sys/sys/vnode.h Sun Sep 3 09:05:48 2017 (r323140) +++ stable/11/sys/sys/vnode.h Sun Sep 3 09:09:28 2017 (r323141) @@ -398,6 +398,7 @@ extern int vttoif_tab[]; #define V_NORMAL 0x0004 /* vinvalbuf: invalidate only regular bufs */ #define V_CLEANONLY 0x0008 /* vinvalbuf: invalidate only clean bufs */ #define V_VMIO 0x0010 /* vinvalbuf: called during pageout */ +#define V_ALLOWCLEAN 0x0020 /* vinvalbuf: allow clean buffers after flush */ #define REVOKEALL 0x0001 /* vop_revoke: revoke all aliases */ #define V_WAIT 0x0001 /* vn_start_write: sleep for suspend */ #define V_NOWAIT 0x0002 /* vn_start_write: don't sleep for suspend */