bcachefs: Put erasure coding behind an EXPERIMENTAL kconfig option
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 23 Nov 2023 22:56:14 +0000 (17:56 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 24 Nov 2023 05:29:58 +0000 (00:29 -0500)
We still have disk space accounting changes coming for erasure coding,
and the changes won't be as strictly backwards compatible as they'd
ought to be - specifically, we need to start accounting striped data
under a separate counter in bch_alloc (which describes buckets).

A fsck will suffice for upgrading/downgrading, but since erasure coding
is the most incomplete major feature of bcachefs it still makes sense to
put behind a separate kconfig option, so that users are fully aware.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/Kconfig
fs/bcachefs/alloc_foreground.c

index c08c2c7d6fbbab79e34b0321b7bdc300fd575dfb..fddc7be580223a54357deb7647b9fa41748679e3 100644 (file)
@@ -33,6 +33,18 @@ config BCACHEFS_QUOTA
        depends on BCACHEFS_FS
        select QUOTACTL
 
+config BCACHEFS_ERASURE_CODING
+       bool "bcachefs erasure coding (RAID5/6) support (EXPERIMENTAL)"
+       depends on BCACHEFS_FS
+       select QUOTACTL
+       help
+       This enables the "erasure_code" filesysystem and inode option, which
+       organizes data into reed-solomon stripes instead of ordinary
+       replication.
+
+       WARNING: this feature is still undergoing on disk format changes, and
+       should only be enabled for testing purposes.
+
 config BCACHEFS_POSIX_ACL
        bool "bcachefs POSIX ACL support"
        depends on BCACHEFS_FS
index b85c7765272f6e4ae5e8aceb5a4bbaa89c535912..5042858719c087969d9eacc55dc337a8123a269b 100644 (file)
@@ -1321,6 +1321,9 @@ int bch2_alloc_sectors_start_trans(struct btree_trans *trans,
        int ret;
        int i;
 
+       if (!IS_ENABLED(CONFIG_BCACHEFS_ERASURE_CODING))
+               erasure_code = false;
+
        BUG_ON(flags & BCH_WRITE_ONLY_SPECIFIED_DEVS);
 
        BUG_ON(!nr_replicas || !nr_replicas_required);