From nobody Mon Jan 31 02:46:59 2022 X-Original-To: dev-commits-src-main@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 152EA197F854; Mon, 31 Jan 2022 02:47:00 +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 4JnCBq3y7Rz3FMq; Mon, 31 Jan 2022 02:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643597219; 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=JBXgvyUqclkrouCJdeyDFefDd+LWJmSRZay7atdu4Y0=; b=NHMLeIK7VgXWKT7CbYyvJpEFj0aAppSlO3o99UME2MnPk2W7GLVoimVqAcuML/7lEJB85p mnXQ4gWHA0meerHBqDDgbgfKWYJj7qmB0fmkiZsl8HXLta/6IAcqu7yByUamaCmJ0nJ4IU +mT+C6ao/bnlrEgf7hCrEv0evS4qzb50c6uOhCMPcL3qPFJVO3d/4aS0kYV67HRs0wyYfp +X3H2kWGemaDEc9zB3Ep2glVpMda9LNy0gsj3i6TVA3xEBNzNSO6aHsJfBk0AQCYatJjqu 0LbsA7uUf+ldvJVC12ohN0SdEenjWur5ZN/SQyvBvx8Xoe6II1QUIO/5ieZd3w== 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 2DEDA1493C; Mon, 31 Jan 2022 02:46:59 +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 20V2kxtl009166; Mon, 31 Jan 2022 02:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20V2kxs0009164; Mon, 31 Jan 2022 02:46:59 GMT (envelope-from git) Date: Mon, 31 Jan 2022 02:46:59 GMT Message-Id: <202201310246.20V2kxs0009164@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: 8d8589b385c9 - main - ufs: be more persistent with finishing some operations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 8d8589b385c901581ee71d09d86d044a6f42dfef Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643597219; 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=JBXgvyUqclkrouCJdeyDFefDd+LWJmSRZay7atdu4Y0=; b=X0nnWOVcsG2G/9x6c1PHZUKx271E8hwbuW1tfTONoH+2ggWEAwrgqmCDgcgtC2ws67b5Ev Vz+sy36qgCZVgneSI1q1nXN9Q3U/DTbRcJCP6fP9tO+3cu57B86sqwaD+MAn2ZwjOUaVL0 N1PAfYW9Vz568LH13lDlmHlGYCLPOxZKMvZzOlGsXXx+pN86wbQww4S4KBv2m/sYmdj7kT QsfUnmMerJA43e4NN8HovtX23WdYPKbEE4rB4lI9opXIV7LbKWyaiSMQ+JtE7eZPu7ETtt qQmzZrFFAam/uUd/XT+MWUBSNTh72Zzh8a6I/O1bhi9lHH5V9u5u+QREOBBP+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643597219; a=rsa-sha256; cv=none; b=G8n9dRURPa2QN3rQuRK7IiAsSCLQVgwLvsbbSURWRZA6ijgHidvT2g9y3KsjM19QPGmGPH huj3Kw7jD4oPmFvEMoUuVzUJb57lgw+KKBa6UwiQzuHEqrie+osU2g8JUC3/QzSZrvRclz tA8e/IBH2Y7c1BvyL88SjvfrEURwK6lZnkXEHehNDR/45nYbYOE8WrJYehy2zV5sd3Hwa8 NtTDj0dBLfGvVqe3OBzTSQatiE7THX9cLpqE2Ef0ExbX+S6T1upsXqdIfgU8VNu9QXck/Q mSawMGuHVmea9oGW8vaUz7+EeQdiNSOq/OwwsDAYwhOMWDbE31zcGsrowBRSDg== 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=8d8589b385c901581ee71d09d86d044a6f42dfef commit 8d8589b385c901581ee71d09d86d044a6f42dfef Author: Konstantin Belousov AuthorDate: 2022-01-18 01:49:36 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-31 02:46:21 +0000 ufs: be more persistent with finishing some operations when the vnode is doomed after relock. The mere fact that the vnode is doomed does not prevent us from doing UFS operations on it while it is still belongs to UFS, which is determined by non-NULL v_data. Not finishing some operations, e.g. not syncing the inode block only because the vnode started reclamation, is not correct. Add macro IS_UFS() which incapsulates the v_data != NULL, and use it instead of VN_IS_DOOMED() for places where the operation completion is important. Reviewed by: markj, mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34072 --- sys/ufs/ffs/ffs_inode.c | 2 +- sys/ufs/ffs/ffs_softdep.c | 2 +- sys/ufs/ffs/ffs_vnops.c | 2 +- sys/ufs/ufs/inode.h | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index d8b86df27121..91d1b78e3d93 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -179,7 +179,7 @@ loop: pause("ffsupd", 1); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vrele(vp); - if (VN_IS_DOOMED(vp)) + if (!IS_UFS(vp)) return (ENOENT); /* diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 0b816b4139d3..f4c146c52249 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -13772,7 +13772,7 @@ softdep_request_cleanup_inactivate(struct mount *mp) vholdl(vp); vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY); VI_LOCK(vp); - if (vp->v_data != NULL && vp->v_usecount == 0) { + if (IS_UFS(vp) && vp->v_usecount == 0) { while ((vp->v_iflag & VI_OWEINACT) != 0) { error = vinactive(vp); if (error != 0 && error != ERELOOKUP) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 24bb39a3d48f..0a2cd5970906 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -2066,7 +2066,7 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) * and respond to dead vnodes by returning ESTALE. */ VOP_LOCK(vp, vp_locked | LK_RETRY); - if (!VN_IS_DOOMED(vp)) + if (IS_UFS(vp)) return (0); /* diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 7ea88d15b1e3..cf02253dcca2 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -247,6 +247,7 @@ I_IS_UFS2(const struct inode *ip) } while (0) #define IS_SNAPSHOT(ip) ((ip)->i_flags & SF_SNAPSHOT) +#define IS_UFS(vp) ((vp)->v_data != NULL) /* * Structure used to pass around logical block paths generated by