From nobody Thu Mar 17 01:40:19 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 795351A151DC; Thu, 17 Mar 2022 01:40:19 +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 4KJqb72r5fz3QmV; Thu, 17 Mar 2022 01:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647481219; 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=NpAGRjwGuTc2B4VsnKWRx5CmVq3i0JddkHIHVtbtSWI=; b=XjIkSXEmHME5D7wVugXYT7gmgcG4E7yfENpMgQxQs6Gu96ldTk33vMsdmmoSAhyLJkEF7I D0QvF9SYWId2SSNZZ760wjorUj6fKkBp+Sz/50DtkRjPbC8EKAqIS2mUytZJyj3gm9B3ZK CBZUloH5j0jNsdrYL3r4JgKLa3cX6dBkQs+Ub1SI3MP2QTl2SpK4HBs0zK42VfAK0BEkKV mj1X/vPvYwp5RCZ679iUwP4GAeSH3Dc9eiQh0MginIHFSMAQjHZi0pqu5re0pIxAuJxXAg lo6hitmoxFuMzd4pDykA2ZUZatmTWpLTPU9R627Bqw1Y1fklri2qnJZFHglk7w== 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 428BF21636; Thu, 17 Mar 2022 01:40:19 +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 22H1eJUW016703; Thu, 17 Mar 2022 01:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22H1eJgW016696; Thu, 17 Mar 2022 01:40:19 GMT (envelope-from git) Date: Thu, 17 Mar 2022 01:40:19 GMT Message-Id: <202203170140.22H1eJgW016696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: ab2dbd9b871d - main - ffs_mount(): fix snapshotting 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: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab2dbd9b871dd00afc6ad78acb386ffa48b6b053 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647481219; 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=NpAGRjwGuTc2B4VsnKWRx5CmVq3i0JddkHIHVtbtSWI=; b=rKuVgSk4Ua71YQ4XYoLlW5mJ6g5VnjG4jn5YF+ohCBQtWKORx9h2gO5sUDlWLpjqY/CzXn g74On7z6j7u4Peu/GPyd0Mv5ODLK+X9cr5tKlSkqq8tyLLc5X/Tc5rT8nfy6UfCyHRCZS/ 4tDlavP1lQJWLOvgFyK/MKCtpa/88y/3XcrFENbb/NbSHWIwtmfvA0SJ8sGSLRfEltwMbY OT0XpWM24m8ctZL9RaZwKPCQguJH8u+2bSHvMm5srYmeOuM3KwWbZkAVn4vFXxp1TMM1AY RI4D2FYgyI7wWWrTpmxr+EJEqzwBYwWCFcDOpvemZgcYKFCdgj2xSvfB52mfMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647481219; a=rsa-sha256; cv=none; b=MVbeUMhOZEeE0JY9B8s12b9AhSPL10eqDlJ/6hvFaCbqChlNsQAFTtuSh/VrK5v/VqWJKP GIPoqZ3s7/fXD+utW2RCWl50qMTqgVhsktVdNAaRiefHWU/RfO2LJA0BZ/ZRfISX3rUzuq w7+7T5kPE2Xj58lvE3QO7vgZU5Lj6zZMWBoteCndQUF6RAvKHCrU9PoLy0rpAHxV2Y2aRg VafSr0UqhG4iurKnyo0LOKffM3dkWtH/zatLVSOsECi6wEfb6CpcYonqo8rESA97zIykqz GXh2o17YiyZjGZSEf+nsJYQACrFSeYS7WB0SD6zVEZ9L6OjKVqAC7uffEmA3DA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=ab2dbd9b871dd00afc6ad78acb386ffa48b6b053 commit ab2dbd9b871dd00afc6ad78acb386ffa48b6b053 Author: Robert Wing AuthorDate: 2022-03-17 01:27:34 +0000 Commit: Robert Wing CommitDate: 2022-03-17 01:32:37 +0000 ffs_mount(): fix snapshotting Commit 0455cc7104ec broke snapshotting for ffs. In that commit, ffs_mount() was changed so the namei() lookup for a disk device happens before ffs_snapshot(). This caused the issue where namei() would lookup the snapshot file and fail because the file doesn't exist. Even if it did exist, taking a snapshot would still fail since it's not a disk device. Fix this by taking a snapshot of the filesystem as-is and return without altering ro/rw or any other attributes that are passed in. Reported by: pho Reviewed by: mckusick Fixes: 0455cc7104ec ("ffs_mount(): return early if namei() fails to lookup disk device") Differential Revision: https://reviews.freebsd.org/D34562 --- sys/ufs/ffs/ffs_vfsops.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 578e71014a23..455508cf9969 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -410,6 +410,12 @@ ffs_mount(struct mount *mp) mp->mnt_flag |= mntorflags; MNT_IUNLOCK(mp); + /* + * If this is a snapshot request, take the snapshot. + */ + if (mp->mnt_flag & MNT_SNAPSHOT) + return (ffs_snapshot(mp, fspec)); + /* * Must not call namei() while owning busy ref. */ @@ -684,11 +690,6 @@ ffs_mount(struct mount *mp) MNT_IUNLOCK(mp); } - /* - * If this is a snapshot request, take the snapshot. - */ - if (mp->mnt_flag & MNT_SNAPSHOT) - return (ffs_snapshot(mp, fspec)); } MNT_ILOCK(mp);