Skip to contentSkip to conversation

mkfs: require reflink for max_atomic_write option

PATCH In review John Garry 2 participants 2 messages Jul 30, 2025

lore
Share & tools
lore

John Garry

author
#0 lore raw

PATCH 1/1 mkfs: require reflink for max_atomic_write option

For max_atomic_write option to be set, it means that the user wants to support atomic writes up to that size.

However, to support this we must have reflink, so enforce that this is available.

mkfs/xfs_mkfs.c +6 -0
index b889c0de..8cd4ccd7 100644
@@ -3101,6 +3101,12 @@ _("metadir not supported without exchange-range support\n"));
 		cli->sb_feat.exchrange = true;
 	}
 
+	if (cli_opt_set(&iopts, I_MAX_ATOMIC_WRITE) && !cli->sb_feat.reflink) {
+		fprintf(stderr,
+_("max_atomic_write option not supported without reflink support\n"));
+		usage();
+	}
+
 	/*
 	 * Copy features across to config structure now.
 	 */
Signature · 1 line
2.43.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · John Garry

For max_atomic_write option to be set, it means that the user wants to support atomic writes up to that size.

However, to support this we must have reflink, so enforce that this is available.

Yeah, makes sense to me :P

--D

Quoted 22 lines
mkfs/xfs_mkfs.c +6 -0
index b889c0de..8cd4ccd7 100644
@@ -3101,6 +3101,12 @@ _("metadir not supported without exchange-range support\n"));
 		cli->sb_feat.exchrange = true;
 	}
 
+	if (cli_opt_set(&iopts, I_MAX_ATOMIC_WRITE) && !cli->sb_feat.reflink) {
+		fprintf(stderr,
+_("max_atomic_write option not supported without reflink support\n"));
+		usage();
+	}
+
 	/*
 	 * Copy features across to config structure now.
 	 */
Signature · 1 line
2.43.5