From nobody Thu Dec 02 02:31:51 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 98D1918ABEC0; Thu, 2 Dec 2021 02:31:51 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4Kj31tmLz4ng7; Thu, 2 Dec 2021 02:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22B7F15714; Thu, 2 Dec 2021 02:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B22Vp21073874; Thu, 2 Dec 2021 02:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B22VpQs073873; Thu, 2 Dec 2021 02:31:51 GMT (envelope-from git) Date: Thu, 2 Dec 2021 02:31:51 GMT Message-Id: <202112020231.1B22VpQs073873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 81c9a051ea35 - stable/13 - swap pager: lock vnode around VOP_CLOSE() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 81c9a051ea35ff784437ba780399447154d56cfa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638412311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ACpMikHLSDl9xwT2m6qpXC221NDeFuEM84M4GikUvqQ=; b=xb4/HMEBHBv5EW4u5hj9pY3W2JAeTzIVLh45E+vIWAZj5Wyr/QlWmjqWo23LDGl8lhsGpI TecIMFrnH44/lsu5Tve8Bs9Kec2jrQTUITLHtfZ6CB1KFufH25MfrOg41dXYWLagoTd1bW DUGUYPb6QzWq9OoZ2sO45FQ2sMPvmoq1re2g8r4X/99MMQMy2SXC6HmaU0bkCwQz/yXZIO cNYodUqRKfUAjrqSEqGHbyeopKweRyuizNFumxoptp4lb1nDDb26xoIpM9mESL1jl5K84H QY2+BAlnbeDLN3j9SJAfWSNtEZNdK1A63b9UZxhgxPCJZOeiPcN7cu6bUpfUCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638412311; a=rsa-sha256; cv=none; b=PQ5OdN19dbZXubj3xHvYLXkft92bY8Zprif57kGJ8eNdO2E6F1xziNy3N01molytDKf3ru 73gfXTjxarYHI4ihvIxxfBiN3Pj/eLjlGJixehO5E6XVR8CQ6Q0yLpJqh0mGw9Y1FlLEQ7 +/I7uh06Cmw3c1Z5rq198trJAJLavPZt2reAz8kqmvjHtA/3MxCV2nmSv0flfMOAdulUPE ve5qVKhgK9RbHtg9+/Er+06O0jwY+P63e2KVJXwGduAbrFWSrhhidb1P9xZ0pd+Hlb+2qv aBWIAlwW1aq3gp+jDZZ4JOM8YWrCoZ9CVN4OMoJJu0w29MmXDmQN6H+OIVE2vA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=81c9a051ea35ff784437ba780399447154d56cfa commit 81c9a051ea35ff784437ba780399447154d56cfa Author: Konstantin Belousov AuthorDate: 2021-11-23 09:16:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-02 02:21:14 +0000 swap pager: lock vnode around VOP_CLOSE() (cherry picked from commit a6d04f34a4db6ff3fd5431ae10d4b877337fc138) --- sys/vm/swap_pager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 6d64ff883966..38c225db51ee 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -3050,9 +3050,12 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp) static void swapdev_close(struct thread *td, struct swdevt *sp) { + struct vnode *vp; - VOP_CLOSE(sp->sw_vp, FREAD | FWRITE, td->td_ucred, td); - vrele(sp->sw_vp); + vp = sp->sw_vp; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td); + vput(vp); } static int