From 0417560649434fc985896c84527fbdadbb06aa42 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 21 Dec 2022 21:41:34 -0500 Subject: Get current metadata version from sysfs This changes the default version for the format command to be the currently supported version, via /sys/modules/bcachefs/parameters/version. Signed-off-by: Kent Overstreet --- cmd_format.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd_format.c') diff --git a/cmd_format.c b/cmd_format.c index 9feb3345..26a1cd9f 100644 --- a/cmd_format.c +++ b/cmd_format.c @@ -219,6 +219,9 @@ int cmd_format(int argc, char *argv[]) break; } + if (opts.version != bcachefs_metadata_version_current) + initialize = false; + if (!devices.nr) die("Please supply a device"); -- cgit v1.2.3