From nobody Mon Jan 31 02:46:55 2022 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 8F3B0197F784; Mon, 31 Jan 2022 02:46:56 +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 4JnCBm2nDQz3F45; Mon, 31 Jan 2022 02:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643597216; 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=0c0+aiERCPvZhmxrJVJh19EW+zDVboCP9EN7yhAW3Dc=; b=N14ZPGrJiQu/v59TGrytcXg8wfDjaqwlNMAb3LIBGJqpO2DN2NuyxoMXKtjHA0BaF5kPyT u5FpPqRMQAiTP7wRp5NEERHtcWe4rTbqF/YAa/4+fNAmdMqEND/PYtlR7v61XyeBebQKxe VUsfMxuxvgNMrGOLcDmsn2l13072qlJd4Oc58/kZDPRgATGx8QfrOtNBZqRnY1qqfwZagg 3BAqFeQTuD0WVhBrapD9vRBiIzB7GD0OanV1nGhzhGv82Y1uEAwJlaeb0wFy8Qwo5XxaDy ETYWTlaE908IC4lw0kbqKyuAK2d74p/WVowS6sufaOmkDSi7yC1UkF42fPkX6A== 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 B6D7614A0C; Mon, 31 Jan 2022 02:46:55 +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 20V2ktxx009090; Mon, 31 Jan 2022 02:46:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20V2ktSR009089; Mon, 31 Jan 2022 02:46:55 GMT (envelope-from git) Date: Mon, 31 Jan 2022 02:46:55 GMT Message-Id: <202201310246.20V2ktSR009089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3d68c4e17578 - main - syncer VOP_FSYNC(): unlock syncer vnode around call to VFS_SYNC() 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/main X-Git-Reftype: branch X-Git-Commit: 3d68c4e17578684cfdfd002fb6ab8554df525963 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643597216; 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=0c0+aiERCPvZhmxrJVJh19EW+zDVboCP9EN7yhAW3Dc=; b=KLvD4ej7jLFth2+0YMc+g6IR+Vx/skOwxf+1z4uFbiE4g66nAeEB3BjI41fQmQ7Da9Dkwj mrz6Rj72yuXHaWjzV/l1uAcfgvuP5V78v5aaJGoAyQUldoS8Pi/1kYctQZOQLY67jFBYh6 2l+ikE1+uzmNmAEMFCku4KAOU82B+OPTIrNFRXjVDDcy6wln9ASTvcyTTBW0y22Qnub4L6 cCXOmxavmXZyP+M8QVkjiMsV5j1I3p1SqD0JsnYax92XwfZxbhLvsKlKCcUTiPx+cb9sKa hsnGqtgpZRhHvslSSgPmPfl3gDlbaXDuNAwI3Ne629eqiValbaSeepH9ZYlQlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643597216; a=rsa-sha256; cv=none; b=Hark3r3YPh+WD2FmgHJNFrzFGqhG36HU/mYOJ+zvPF/umj6AmGDyML0Lt7RYX3qZjBGJP3 FM05wCbGqLMFNmvloy6zsl/OBpV44okPpe4cPF9A64DBOv+iTU2Tt0WPwuT/wJ3s4fDvqs zGvyMUgaul3od1TCVzGUoulgs+85mW76LvH9UVTBYqqpaMS5OZr6q34rwiJ+bWVNec/L6i FFXVBUyXc3Vgvhu5NbjyKsVEWdMsHPJQR4m8CIO9Wr4IOqMsWOA6OHpGMJTetgop22fosm QhNx8k35OP7mi+AmZjIwIvITcmamjfnG6kUpXOfYWo7kB53G9K2XW1zXgQtVZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3d68c4e17578684cfdfd002fb6ab8554df525963 commit 3d68c4e17578684cfdfd002fb6ab8554df525963 Author: Konstantin Belousov AuthorDate: 2022-01-21 15:42:28 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-31 02:46:21 +0000 syncer VOP_FSYNC(): unlock syncer vnode around call to VFS_SYNC() The lock is unneccessary since the mount point is busied, which prevents unmount and syncer vnode deallocation. Having the vnode locked causes innocent LoRs and complicates debugging. Also stop starting write accounting around it. Any caller of VOP_FSYNC() must do it already, and sync_vnode() does. Reported and tested by: pho Reviewed by: markj, mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34072 --- sys/kern/vfs_subr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 3218a3f7b6a0..839282fe318f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -5059,10 +5059,7 @@ sync_fsync(struct vop_fsync_args *ap) */ if (vfs_busy(mp, MBF_NOWAIT) != 0) return (0); - if (vn_start_write(NULL, &mp, V_NOWAIT) != 0) { - vfs_unbusy(mp); - return (0); - } + VOP_UNLOCK(syncvp); save = curthread_pflags_set(TDP_SYNCIO); /* * The filesystem at hand may be idle with free vnodes stored in the @@ -5071,7 +5068,7 @@ sync_fsync(struct vop_fsync_args *ap) vfs_periodic(mp, MNT_NOWAIT); error = VFS_SYNC(mp, MNT_LAZY); curthread_pflags_restore(save); - vn_finished_write(mp); + vn_lock(syncvp, LK_EXCLUSIVE | LK_RETRY); vfs_unbusy(mp); return (error); }