From nobody Thu May 16 01:01:53 2024 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 4VfsHj4kCFz5KBDy; Thu, 16 May 2024 01:01:53 +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 4VfsHj3nmTz4Sfy; Thu, 16 May 2024 01:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715821313; 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=+OX0FIt9r6nqrhtDq8wMHwhAlzC/W8eYrXyRvL6jqwA=; b=KuakyJ0NT9mHJqZ5tSjfkQmFpjTo35wr65+MKCiddtK/eVrWlpJOuAblgue/BiLzP7/pdW ExubmnpOH1PSHWfSYmG/VQq9YMmRuxMDO1rKlz5wYacT+QgB9WuEtBUf/CwzT7RK7hdnLZ Ygu60NhrTs2h2/dAEz+sAErQZ/BNTX6P5sBnnvRq1Xau8Hb7bEHNQq4bUkwsD5x6TExRtw xcVqrriwC19XEdjB8YkEK9nUByT4uS39Yia06OPVVhsrzrJv7S/G1efFuCVi7Le0yizD+l T9MOnr8wfREkX/HZcZrRCIhxNQnZwQDe9UV77UI6B05Jku6Cji7qEiq0kWuwIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715821313; a=rsa-sha256; cv=none; b=pKxY5BwACsO6iVWK1YVHffeTF491butp9JShJGSGAdHmgYGx9m35dmbusg9VkoMyinCH2D JuihtCD1U3uRx2kNGb/2k9VbRDf3UN68/+Q9aeU9WP8OXUbYYrHPWxnUSjJjdMF/nPuYgO djwSMxxUFOWa5TDzwuyBiyC/XMla5W6K2aa3VU3CqZhTJNI2vrfzk6ISOKtMF1nEjJck+B bPr0S6DeUfL+DdHMWtxNzT/SEXppeB16VXb2VrJwfZ/F0AZveFUTRieblwchwRD93vgwPI B4gW4i4US8YkiI67fCqVoEYiR48ediTUp6hEoOTKfsz5RrhwTludz2U6tc41xg== 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=1715821313; 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=+OX0FIt9r6nqrhtDq8wMHwhAlzC/W8eYrXyRvL6jqwA=; b=MRR8xgZgzmPZ9OevX/q1Tf3GcyWuzUzcxb7NhNjuaKphHDhHsJ6Lxq3i3bHZ526Brv3EtS n/fNxUYtPAx4oBAmuuPawmjl912beeDumS06dohAngrh+e65lZWfg2oEroOeroEEvqgCji x+tY+az4LwOdlv2mUdHY8S7n62lEoTrwK6keWtbRoCfxaLLAroNUoM+e3CG23KC5dRLHxr IJp4Q8fh+d4oS2/vVe187O0d0ffIrBJ+hmAV6YbNV+nKaZwng2Hv6q5jh09GChaTl0vs0n ZiV2JieDyxvlJ2xEBhvYfOxNOOYyfPFdxL7c4CPDxIMT4P7ebU7kowz/T80Hqg== 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 4VfsHj3PtFzds3; Thu, 16 May 2024 01:01:53 +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 44G11rU1087282; Thu, 16 May 2024 01:01:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G11rk3087279; Thu, 16 May 2024 01:01:53 GMT (envelope-from git) Date: Thu, 16 May 2024 01:01:53 GMT Message-Id: <202405160101.44G11rk3087279@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: 21ccdb4119af - main - vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 21ccdb4119afdfdfeaa80e9c8514171c65b35862 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=21ccdb4119afdfdfeaa80e9c8514171c65b35862 commit 21ccdb4119afdfdfeaa80e9c8514171c65b35862 Author: Konstantin Belousov AuthorDate: 2024-05-15 09:54:49 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-16 01:00:26 +0000 vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done The file system that handles updating the mount point might do lookups during the update, in which case it could find the flag MNT_UNION set on the mp while mount point is still not updated. In particular, the rootvp->v_mount->mnt_vnodecovered is not yet set. Delay setting MNT_UNION until the mount is performed. PR: 265311 Reported by: Robert Morris Reviewed by: mckusick, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45208 --- sys/kern/vfs_mount.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 4961eb332473..f5ff8d54fadd 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1313,7 +1313,7 @@ vfs_domount_update( void *bufp; struct mount *mp; int error, export_error, i, len, fsid_up_len; - uint64_t flag; + uint64_t flag, mnt_union; gid_t *grps; fsid_t *fsid_up; bool vfs_suser_failed; @@ -1395,6 +1395,7 @@ vfs_domount_update( vfs_deleteopt(*optlist, "fsid"); } + mnt_union = 0; MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { MNT_IUNLOCK(mp); @@ -1416,6 +1417,11 @@ vfs_domount_update( mp->mnt_flag |= MNT_UPDATE; } else { mp->mnt_flag &= ~MNT_UPDATEMASK; + if ((mp->mnt_flag & MNT_UNION) == 0 && + (fsflags & MNT_UNION) != 0) { + fsflags &= ~MNT_UNION; + mnt_union = MNT_UNION; + } mp->mnt_flag |= fsflags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE | MNT_SNAPSHOT | MNT_ROOTFS | MNT_UPDATEMASK | MNT_RDONLY); if ((mp->mnt_flag & MNT_ASYNC) == 0) @@ -1519,6 +1525,7 @@ vfs_domount_update( if (error == 0) { mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); + mp->mnt_flag |= mnt_union; } else { /* * If we fail, restore old mount flags. MNT_QUOTA is special,