From owner-svn-src-all@freebsd.org Wed Jun 5 20:16:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C0815B825C; Wed, 5 Jun 2019 20:16:26 +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 8493A6B67C; Wed, 5 Jun 2019 20:16:26 +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 5D42AA08D; Wed, 5 Jun 2019 20:16:26 +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 x55KGQbZ040200; Wed, 5 Jun 2019 20:16:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55KGQpL040198; Wed, 5 Jun 2019 20:16:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906052016.x55KGQpL040198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 5 Jun 2019 20:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348698 - in head/sys/fs: nullfs tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/fs: nullfs tmpfs X-SVN-Commit-Revision: 348698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8493A6B67C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Wed, 05 Jun 2019 20:16:27 -0000 Author: kib Date: Wed Jun 5 20:16:25 2019 New Revision: 348698 URL: https://svnweb.freebsd.org/changeset/base/348698 Log: Manually clear text references on reclaim for nullfs and tmpfs. Both filesystems do no use vnode_pager_dealloc() which would handle this case otherwise. Nullfs because vnode vm_object handle never points to nullfs vnode. Tmpfs because its vm_object is never vnode object at all. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nullfs/null_vnops.c head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Wed Jun 5 19:55:30 2019 (r348697) +++ head/sys/fs/nullfs/null_vnops.c Wed Jun 5 20:16:25 2019 (r348698) @@ -810,6 +810,8 @@ null_reclaim(struct vop_reclaim_args *ap) */ if (vp->v_writecount > 0) VOP_ADD_WRITECOUNT(lowervp, -vp->v_writecount); + else if (vp->v_writecount < 0) + vp->v_writecount = 0; VI_UNLOCK(vp); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Jun 5 19:55:30 2019 (r348697) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Jun 5 20:16:25 2019 (r348698) @@ -488,6 +488,8 @@ tmpfs_destroy_vobject(struct vnode *vp, vm_object_t ob VI_LOCK(vp); vm_object_clear_flag(obj, OBJ_TMPFS); obj->un_pager.swp.swp_tmpfs = NULL; + if (vp->v_writecount < 0) + vp->v_writecount = 0; VI_UNLOCK(vp); VM_OBJECT_WUNLOCK(obj); }