From nobody Thu Jan 27 16:34:40 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 E5999197FA37; Thu, 27 Jan 2022 16:34:40 +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 4Jl5lh5pztz3qpb; Thu, 27 Jan 2022 16:34:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643301280; 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=VecjIlGYAfIBj64NXmasQ1lstXZAwWwuuO9vAU4+y1o=; b=lQ2OL3bLTDJk9aylx1GYQsPxWb+USUZH0CJFz2+7xyo07xUK8AS+djCy/NGg64RPu85Ume BD/Fnu5s+DGUZsL8Hjifx2rkTU3NDee8sctxZojTWGv0bq48ZKz0R24ssm9ZMFjzUV9mMS /nCDGw1QPExaNhTf6MHKwdck4wEdInAGGZTJA/lNPRPGoSExbjrJOXUKyocFRUXs1pk5ZI O2GjBDEO/7X1gup+0rVORgj8JhQVT41yRgGNX/W+I/Wwmy0nuCOb2cx0d6tvUXcOdfVH69 Rr10dTjN8FJaZL6qB/+qQoHqNp0/V0ocQ11eA+Tasx06mOLi5StKVxQlZuDKAg== 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 928E91A2D2; Thu, 27 Jan 2022 16:34:40 +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 20RGYeoW013549; Thu, 27 Jan 2022 16:34:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20RGYeit013548; Thu, 27 Jan 2022 16:34:40 GMT (envelope-from git) Date: Thu, 27 Jan 2022 16:34:40 GMT Message-Id: <202201271634.20RGYeit013548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 2a7e4cf84311 - main - Revert b58ca5df0bb7 ("vfs: remove the now unused insmntque1") 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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a7e4cf84311c9ec6cc5366d24fadfb188e6ccdc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643301280; 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=VecjIlGYAfIBj64NXmasQ1lstXZAwWwuuO9vAU4+y1o=; b=CdY5VgsN++Xdvxf2ZMP0ccZH5/hIhTkvMlaPP3CnflGHyZ4/aTGM52xgippg7BHlIqolAj tP3vmr5v6aykL6NCkHJqepjWRdwkDdU1PszVHT8E9wUJIWWt8yhww5uw/V+/O0VCigR4+6 emecDg0ym7VpI3vXpYfhYy46Eh/ADphSVrWa86knn3avwtVFDFJz4Ljq1WMoZ2ILmnujrx YOyzU/cEF5GLX2xTx+DZHA0TPMWtV72OlTbnNO7NOGtIVuGacrvs9WSZB/kHUi6s04St8c 6KaSEXwZD8CNVc/7HugPfRUFXUeoe8fN2cYSjrAzY6vpkkYtsPi7HGJyUZKBZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643301280; a=rsa-sha256; cv=none; b=ML50cI4ZVVT8pQYmMauSVIj9OoDHsC2X/CvTBk7uzB6Pvlt/BqI4ePsT4gNkm7SpbOg9zY nZ80Pe/nwWc3QOggt8bg7JIEz+IMkqAzApGxzpWR7YvGYWlikxVoudEzHe7W8HF+SGlp9X Z96tMoRFcKcsNYQy5gAggC7cxZVL2qDb1BhQJWq5Uy7FGyMjbxUz36Z+4h75hVXt55Npac zmgNBhbY1FTBFRH/zcm12f8kUCpqKW8CUkEPKpMz1x1ocke94ONkkhgAnNh9Ibx/bAR6aO Fx3m6K2aVLvhj8Q8gSRmcIseVCJLEmCceNaULfj33Du3Db3NqLr7duT3HFOFFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2a7e4cf84311c9ec6cc5366d24fadfb188e6ccdc commit 2a7e4cf84311c9ec6cc5366d24fadfb188e6ccdc Author: Mateusz Guzik AuthorDate: 2022-01-27 16:24:32 +0000 Commit: Mateusz Guzik CommitDate: 2022-01-27 16:32:22 +0000 Revert b58ca5df0bb7 ("vfs: remove the now unused insmntque1") I was somehow convinced that insmntque calls insmntque1 with a NULL destructor. Unfortunately this worked well enough to not immediately blow up in simple testing. Keep not using the destructor in previously patched filesystems though as it avoids unnecessary casts. Noted by: kib Reported by: pho --- sys/fs/devfs/devfs_vnops.c | 2 +- sys/fs/fdescfs/fdesc_vnops.c | 2 +- sys/fs/nullfs/null_subr.c | 4 ++-- sys/fs/tmpfs/tmpfs_subr.c | 2 +- sys/fs/unionfs/union_subr.c | 2 +- sys/kern/vfs_subr.c | 12 +++++++++++- sys/sys/param.h | 2 +- sys/sys/vnode.h | 2 ++ 8 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index dae4079c2c6c..38d581db9154 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -615,7 +615,7 @@ loop: vp->v_data = de; de->de_vnode = vp; mtx_unlock(&devfs_de_interlock); - error = insmntque(vp, mp); + error = insmntque1(vp, mp, NULL, NULL); if (error != 0) { devfs_insmntque_dtr(vp, de); (void) devfs_allocv_drop_refs(1, dmp, de); diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 0f6111586a38..1dead8f1153c 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -191,7 +191,7 @@ loop: fd->fd_ix = ix; if (ftype == Fdesc && fmp->flags & FMNT_LINRDLNKF) vp->v_vflag |= VV_READLINK; - error = insmntque(vp, mp); + error = insmntque1(vp, mp, NULL, NULL); if (error != 0) { vgone(vp); vput(vp); diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c index 982c7d798bb2..acf77d5cfd47 100644 --- a/sys/fs/nullfs/null_subr.c +++ b/sys/fs/nullfs/null_subr.c @@ -202,7 +202,7 @@ null_nodeget(struct mount *mp, struct vnode *lowervp, struct vnode **vpp) } /* - * The insmntque() call below requires the exclusive lock on + * The insmntque1() call below requires the exclusive lock on * the nullfs vnode. Upgrade the lock now if hash failed to * provide ready to use vnode. */ @@ -235,7 +235,7 @@ null_nodeget(struct mount *mp, struct vnode *lowervp, struct vnode **vpp) vp->v_type = lowervp->v_type; vp->v_data = xp; vp->v_vnlock = lowervp->v_vnlock; - error = insmntque(vp, mp); + error = insmntque1(vp, mp, NULL, NULL); if (error != 0) { vput(lowervp); null_destroy_proto(vp, xp); diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 234984b47c59..c6ac1b0bf357 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -983,7 +983,7 @@ loop: if (vp->v_type != VFIFO) VN_LOCK_ASHARE(vp); - error = insmntque(vp, mp); + error = insmntque1(vp, mp, NULL, NULL); if (error != 0) { tmpfs_insmntque_dtr(vp); vp = NULL; diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 57b6051104de..e051d42c07cc 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -386,7 +386,7 @@ unionfs_nodeget(struct mount *mp, struct vnode *uppervp, vp->v_vflag |= VV_ROOT; vn_lock_pair(lowervp, false, uppervp, false); - error = insmntque(vp, mp); + error = insmntque1(vp, mp, NULL, NULL); if (error != 0) { unionfs_nodeget_cleanup(vp, unp); return (error); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a29f64fddd34..3218a3f7b6a0 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1948,7 +1948,8 @@ insmntque_stddtr(struct vnode *vp, void *dtr_arg) * Insert into list of vnodes for the new mount point, if available. */ int -insmntque(struct vnode *vp, struct mount *mp) +insmntque1(struct vnode *vp, struct mount *mp, + void (*dtr)(struct vnode *, void *), void *dtr_arg) { KASSERT(vp->v_mount == NULL, @@ -1973,6 +1974,8 @@ insmntque(struct vnode *vp, struct mount *mp) (vp->v_vflag & VV_FORCEINSMQ) == 0) { VI_UNLOCK(vp); MNT_IUNLOCK(mp); + if (dtr != NULL) + dtr(vp, dtr_arg); return (EBUSY); } vp->v_mount = mp; @@ -1986,6 +1989,13 @@ insmntque(struct vnode *vp, struct mount *mp) return (0); } +int +insmntque(struct vnode *vp, struct mount *mp) +{ + + return (insmntque1(vp, mp, insmntque_stddtr, NULL)); +} + /* * Flush out and invalidate all buffers associated with a bufobj * Called with the underlying object locked. diff --git a/sys/sys/param.h b/sys/sys/param.h index 6bf688105329..948a34da94ec 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400052 +#define __FreeBSD_version 1400051 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 390cb8791f54..a1dbdcff4cb5 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -689,6 +689,8 @@ int getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, struct vnode **vpp); void getnewvnode_reserve(void); void getnewvnode_drop_reserve(void); +int insmntque1(struct vnode *vp, struct mount *mp, + void (*dtr)(struct vnode *, void *), void *dtr_arg); int insmntque(struct vnode *vp, struct mount *mp); u_quad_t init_va_filerev(void); int speedup_syncer(void);