From owner-dev-commits-src-branches@freebsd.org Tue Sep 7 00:39:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 9D82567DB77; Tue, 7 Sep 2021 00:39:57 +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 4H3RHd40Csz4vb3; Tue, 7 Sep 2021 00:39:57 +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 6A1316EB; Tue, 7 Sep 2021 00:39:57 +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 1870dvFs062196; Tue, 7 Sep 2021 00:39:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1870dvd0062195; Tue, 7 Sep 2021 00:39:57 GMT (envelope-from git) Date: Tue, 7 Sep 2021 00:39:57 GMT Message-Id: <202109070039.1870dvd0062195@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: 93c52669d510 - stable/13 - ffs_update(): Do not assume that EBUSY can only come LK_NOWAIT trylock 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: 93c52669d510fe38a185c71eab7fdae990ece823 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 00:39:57 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=93c52669d510fe38a185c71eab7fdae990ece823 commit 93c52669d510fe38a185c71eab7fdae990ece823 Author: Konstantin Belousov AuthorDate: 2021-08-26 16:17:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-07 00:39:32 +0000 ffs_update(): Do not assume that EBUSY can only come LK_NOWAIT trylock (cherry picked from commit bb536de6c0d73566e610881e12c55489a7c6ec44) --- sys/ufs/ffs/ffs_inode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 96abdcd8f4b7..6bb7521cef4c 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -153,9 +153,14 @@ loop: error = ffs_breadz(VFSTOUFS(vp->v_mount), ITODEVVP(ip), bn, bn, (int) fs->fs_bsize, NULL, NULL, 0, NOCRED, flags, NULL, &bp); if (error != 0) { - if (error != EBUSY) + /* + * If EBUSY was returned without GB_LOCK_NOWAIT (which + * requests trylock for buffer lock), it is for some + * other reason and we should not handle it specially. + */ + if (error != EBUSY || (flags & GB_LOCK_NOWAIT) == 0) return (error); - KASSERT((IS_SNAPSHOT(ip)), ("EBUSY from non-snapshot")); + /* * Wait for our inode block to become available. *