From nobody Tue Oct 24 00:47:47 2023 X-Original-To: dev-commits-src-branches@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 4SDth41tVnz4xCkT; Tue, 24 Oct 2023 00:47:48 +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 4SDth41N4nz4PMl; Tue, 24 Oct 2023 00:47:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698108468; 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=3hDm3AVlqWxleHY5qGtGCG4vl/rPeNRPQGVq+G/DTmQ=; b=wppbgBiD00gObPVM2S9/xn+pA1sg6En7KCrYAe5hRSuwpr0+vGZOqCBHKnRC7wAWo5GFah sam8rKiEK/XfXMMbPc8/IcP9zE8G4FR/WOAGxsg8EAIRmvFpCs1ZKCoNZRleHBwOEjO7rh kkg4rrUiGUcKOIpHUBZ3frjhxbFCX5U+Qa7c+92i1kI20gXHa9ik4zps5Aq2v2ULHHdVNT ADgagUhkt3jN+UUBy2OYSIEQj3tiUsBRYihaF8cTNflF09votkvOdvZkT5rTxOkak10lsG vhjiMFkdOpS0tiJZg0TCBUQZFhTKtRom4JldiVF6pi/lHxXv481WsKrcu41Qhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698108468; a=rsa-sha256; cv=none; b=UeL5Jri7+9mebgjMzoWuPwYmnqx5YuhmbvckaE9H/2bfpJGcHAnaUzvymqae0k9lziPYKn ZgYXrRc+HWlm7sLCaKqUHEZh9aooDGK0R7ImSwHRaIPw2kYMA5AVkSiNJAOeGvWfDP7N+v fAZ3kJrDz9cgxDXO1FVYVw5B+8QEjz7cYIyQMNYbyJH2W+cvjMymIXMsdu9OaGv81NRcnR 3msWp/fKml9L6WAVCJJTyfQLnar35omIS5bSdVxCYG41AtubgD9XsVjUjKKVjj+mAWTig+ nEaGHN2hRTKpVqoyuptINhL6E1AUvQDQ57+ibDOGe/j9fG/sPjc3nj2JjVqa3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698108468; 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=3hDm3AVlqWxleHY5qGtGCG4vl/rPeNRPQGVq+G/DTmQ=; b=RbATiof0os5q6vvTjc91WqCGu4AtX8WZENnvmupABKvm0gqHkicXKDoDZMNuZQI0ipsgHm tH9n/wrs81hcbfFTB4JE4Ucb8B60sB4zenDaEIBd6L+mJVZJifCAZEsNL1+bIDhMZ6W7cw O1yHBT9UA3+ByHP+KqKRwKhfoYGavcc/y0xb0YOOLyiuIWGeiEvihgK8tUqgPUQzOAzOJA YPvynKwdq95ZWuaO/soERHJWbc6g0X8wB/K3xJgnMrpryQJSseguAbhXn2FGm+sF4GRs57 kyWqGPdL2lqgWJvUGrTjOfpczzWD0z3phKTYchoX1lqAl3kOUymAFuYEYMgWpA== 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 4SDth40Rr4z12Hx; Tue, 24 Oct 2023 00:47:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39O0ll3C005024; Tue, 24 Oct 2023 00:47:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39O0llqL005021; Tue, 24 Oct 2023 00:47:47 GMT (envelope-from git) Date: Tue, 24 Oct 2023 00:47:47 GMT Message-Id: <202310240047.39O0llqL005021@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: 321af2d24da0 - stable/13 - nmount(MNT_UPDATE): add optional generid fsid parameter List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 321af2d24da0a54612f473afca2d3fec5820132f Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=321af2d24da0a54612f473afca2d3fec5820132f commit 321af2d24da0a54612f473afca2d3fec5820132f Author: Konstantin Belousov AuthorDate: 2023-09-29 18:42:50 +0000 Commit: Konstantin Belousov CommitDate: 2023-10-24 00:47:19 +0000 nmount(MNT_UPDATE): add optional generid fsid parameter (cherry picked from commit 9ef7a491a4236810e50f0a2ee8d52f5c4bb02c64) --- sys/kern/vfs_mount.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 25c4adeaae62..a4a981603ab6 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1154,9 +1154,10 @@ vfs_domount_update( struct vnode *rootvp; void *bufp; struct mount *mp; - int error, export_error, i, len; + int error, export_error, i, len, fsid_up_len; uint64_t flag; gid_t *grps; + fsid_t *fsid_up; bool vfs_suser_failed; ASSERT_VOP_ELOCKED(vp, __func__); @@ -1219,10 +1220,24 @@ vfs_domount_update( VI_UNLOCK(vp); VOP_UNLOCK(vp); + rootvp = NULL; + + if (vfs_getopt(*optlist, "fsid", (void **)&fsid_up, + &fsid_up_len) == 0) { + if (fsid_up_len != sizeof(*fsid_up)) { + error = EINVAL; + goto end; + } + if (fsidcmp(&fsid_up, &mp->mnt_stat.f_fsid) != 0) { + error = ENOENT; + goto end; + } + vfs_deleteopt(*optlist, "fsid"); + } + vfs_op_enter(mp); vn_seqc_write_begin(vp); - rootvp = NULL; MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { MNT_IUNLOCK(mp);