git: b45276b1693d - stable/14 - Do not allow snapshots on UFS filesystems using gjournal.

From: Kirk McKusick <mckusick_at_FreeBSD.org>
Date: Sun, 28 Jul 2024 19:04:19 UTC
The branch stable/14 has been updated by mckusick:

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

commit b45276b1693db0f13d6203a8b989fe7ea856dbfb
Author:     Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2024-07-25 06:09:58 +0000
Commit:     Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2024-07-28 19:04:10 +0000

    Do not allow snapshots on UFS filesystems using gjournal.
    
    PR:          280216
    
    (cherry picked from commit cab41e0dd31d184bdb0d14403ca71a0f6c9a5e83)
---
 sys/ufs/ffs/ffs_snapshot.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index 7e8c4dbb17d1..fedac50e38fb 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -224,6 +224,15 @@ ffs_snapshot(struct mount *mp, char *snapfile)
 	ump = VFSTOUFS(mp);
 	fs = ump->um_fs;
 	sn = NULL;
+	/*
+	 * At the moment, filesystems using gjournal cannot support
+	 * taking snapshots.
+	 */
+	if ((mp->mnt_flag & MNT_GJOURNAL) != 0) {
+		vfs_mount_error(mp, "%s: Snapshots are not yet supported when "
+		    "using gjournal", fs->fs_fsmnt);
+		return (EOPNOTSUPP);
+	}
 	MNT_ILOCK(mp);
 	flag = mp->mnt_flag;
 	MNT_IUNLOCK(mp);