From nobody Tue Sep 27 15:58:30 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 4McPRp6HDBz4V6kw; Tue, 27 Sep 2022 15:58:30 +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 4McPRp5hpDz3kCr; Tue, 27 Sep 2022 15:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664294310; 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=HkgrHzoFhQN73/evnXWnr8EBauidSUZoup5bl279aYY=; b=PsWvbOhKzcWlBaWnCYg/a58JArRjT6FDyEnWoda+QzBeRu2t2WpTIgWT0BGD1DjCoJUrMe oi6DQzXW1hJQyS2fbbPWIU7BJRXA9ZhOvxKnP5WqhXUnNSYnoTLwlpF0X35ONEqp7Iqi/S PBr2hFOE+zcmbAiV/IJ9/0klAp2kYW1XA+Dmx8WrWzci1RPcVwwUCVVdZe3AUWlP0fk6w+ zvH5tiz7AQO88hbwbVR5UgX0q4EjISRSaDN4N2JCTkiatLPVw5DFcZAwe6BUU4Sw2IAxDz V5pC/bHxn0VSjv82Frqys/k/MdW7kh6Z6Yx5vPlJPMCK6MjgengYRYBycMfVrg== 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 4McPRp4VVGz19RK; Tue, 27 Sep 2022 15:58:30 +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 28RFwUEY064427; Tue, 27 Sep 2022 15:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28RFwUB5064426; Tue, 27 Sep 2022 15:58:30 GMT (envelope-from git) Date: Tue, 27 Sep 2022 15:58:30 GMT Message-Id: <202209271558.28RFwUB5064426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 27d673fbbb79 - main - When taking a snapshot on a UFS/FFS filesystem, it must be mounted. 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: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27d673fbbb79b1b829484ec127da59b45f623ebd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664294310; 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=HkgrHzoFhQN73/evnXWnr8EBauidSUZoup5bl279aYY=; b=XUUiwUDr725g3FNlh1cPKbJhPWu0ABylzi07FnwUPkyAm/5HRvj8nAs3Dj6nubJvyCyDmu OC8CzgLP7xvZycIWEBIfxrpxdA12TeltPyzdqeJqX5EUerisIOoiWOn+dOHkL/AngApYN4 9jW1O0yftHT2wSVHKdOMaUkEfoKosh8zSCs/ypfaoXwmqE0d1c4XyhA+02aB1+9gXCQ5NT 3g3vlP+2FtY/rXzFG5TLiGlDoixTSYwhZ7w8/qCTdncMPDKp3rrVQ2se2dxJt8/0dor924 QVbUIlKNGKJO54t4AhaRMT+a9n+1/nwXuZY5LvCKHDbCNg58uoDTpWdH7vpl0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664294310; a=rsa-sha256; cv=none; b=Axx2kzIC48b/2JoM3SqGe8QiI0aVA1m9Wuv0rDcsQyTDDJkhRGdR45PzsmaBVRLNyCaIiD I6u4tXsAkT6M7LNHxHMk4YLDeYhxKlNcrsd8ibQn4NtyhH0hxv63C+F6Gyf5CjFu76X7t1 eCVy1++2a5jeF34i+C8G1/xA7r7D1UEBQ8udds0OOq9LdbqhW/9sDDAU9gqRqxPmyQdGqM 2cvfqcef2eaA0zRRN3q2FOMkE4kLwhB0sCsPAwg5gYK9SMLsnL5VyG90O1lP/YrRf/OBFA Zh6N/o91iZpYAswsePRZJFKL79rzLk0FrLxh22DZiQbD9izevC1CoO33nD2SAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=27d673fbbb79b1b829484ec127da59b45f623ebd commit 27d673fbbb79b1b829484ec127da59b45f623ebd Author: Kirk McKusick AuthorDate: 2022-09-27 15:57:30 +0000 Commit: Kirk McKusick CommitDate: 2022-09-27 15:58:10 +0000 When taking a snapshot on a UFS/FFS filesystem, it must be mounted. The "update" mount option must be specified when the "snapshot" mount option is used. Return EINVAL if the "snapshot" option is specified without the "update" option also requested. Reported by: Robert Morris Reviewed by: kib PR: 265362 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vfsops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 4768d610b287..8f6e186b44b2 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -413,8 +413,11 @@ ffs_mount(struct mount *mp) /* * If this is a snapshot request, take the snapshot. */ - if (mp->mnt_flag & MNT_SNAPSHOT) + if (mp->mnt_flag & MNT_SNAPSHOT) { + if ((mp->mnt_flag & MNT_UPDATE) == 0) + return (EINVAL); return (ffs_snapshot(mp, fspec)); + } /* * Must not call namei() while owning busy ref.