From owner-svn-src-stable-12@freebsd.org Wed Oct 30 07:54:35 2019 Return-Path: Delivered-To: svn-src-stable-12@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 82BA917CC78; Wed, 30 Oct 2019 07:54:35 +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 4731232gPpz4Yqf; Wed, 30 Oct 2019 07:54:35 +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 3EF2F73F0; Wed, 30 Oct 2019 07:54:35 +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 x9U7sZrZ024149; Wed, 30 Oct 2019 07:54:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U7sZ9t024148; Wed, 30 Oct 2019 07:54:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910300754.x9U7sZ9t024148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Oct 2019 07:54:35 +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: r354168 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 354168 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-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 07:54:35 -0000 Author: kib Date: Wed Oct 30 07:54:34 2019 New Revision: 354168 URL: https://svnweb.freebsd.org/changeset/base/354168 Log: MFC r353930: Fix undefined behavior. Modified: stable/12/sys/kern/vfs_subr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_subr.c ============================================================================== --- stable/12/sys/kern/vfs_subr.c Wed Oct 30 04:00:44 2019 (r354167) +++ stable/12/sys/kern/vfs_subr.c Wed Oct 30 07:54:34 2019 (r354168) @@ -1244,7 +1244,7 @@ vnlru_proc(void) { struct mount *mp, *nmp; unsigned long onumvnodes; - int done, force, trigger, usevnodes; + int done, force, trigger, usevnodes, vsp; bool reclaim_nc_src; EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc, @@ -1272,7 +1272,8 @@ vnlru_proc(void) force = 1; vstir = 0; } - if (vspace() >= vlowat && force == 0) { + vsp = vspace(); + if (vsp >= vlowat && force == 0) { vnlruproc_sig = 0; wakeup(&vnlruproc_sig); msleep(vnlruproc, &vnode_free_list_mtx, @@ -1339,7 +1340,8 @@ vnlru_proc(void) * After becoming active to expand above low water, keep * active until above high water. */ - force = vspace() < vhiwat; + vsp = vspace(); + force = vsp < vhiwat; } } @@ -1416,8 +1418,10 @@ vtryrecycle(struct vnode *vp) static void vcheckspace(void) { + int vsp; - if (vspace() < vlowat && vnlruproc_sig == 0) { + vsp = vspace(); + if (vsp < vlowat && vnlruproc_sig == 0) { vnlruproc_sig = 1; wakeup(vnlruproc); }