git: 21161df3e032 - stable/13 - Do not allow snapshots on UFS filesystems using gjournal.

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

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

commit 21161df3e032252e7533a183acbc5374157b66f1
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:06:52 +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 d4280391f48c..bc4dbdf52e5b 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);