Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2022 15:43:54 GMT
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 0ae91878cc45 - stable/13 - When taking a snapshot on a UFS/FFS filesystem, it must be mounted.
Message-ID:  <202210131543.29DFhsuK022716@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mckusick:

URL: https://cgit.FreeBSD.org/src/commit/?id=0ae91878cc451ce5d45bbec815db830e0bc4c591

commit 0ae91878cc451ce5d45bbec815db830e0bc4c591
Author:     Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2022-09-27 15:57:30 +0000
Commit:     Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2022-10-13 15:43:41 +0000

    When taking a snapshot on a UFS/FFS filesystem, it must be mounted.
    
    PR:           265362
    Sponsored by: The FreeBSD Foundation
    
    (cherry picked from commit 27d673fbbb79b1b829484ec127da59b45f623ebd)
---
 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 5daf8e0e607e..2d5db7722a0f 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -440,8 +440,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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210131543.29DFhsuK022716>