aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2023-09-15 09:40:25 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-09-19 16:15:56 -0400
commitf68e0ed16e93d3bb2515168aae3432351110e993 (patch)
tree3e6a42b6af01ccf54062874ecbc6d010fba5d608
parent9fe08ba354453dddc527313f6787ddaaf5361a5e (diff)
downloadbcachefs-tools-f68e0ed16e93d3bb2515168aae3432351110e993.tar.gz
libbcachefs: convert sb features mask to little endian
bch_sb.features is an array of __le64. Convert the native endian format of the features mask appropriately. This causes a bcachefs format to produce an unmountable fs when run from a big endian system. Signed-off-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--libbcachefs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbcachefs.c b/libbcachefs.c
index bac772b2..44a5fbf3 100644
--- a/libbcachefs.c
+++ b/libbcachefs.c
@@ -193,7 +193,7 @@ struct bch_sb *bch2_format(struct bch_opt_strs fs_opt_strs,
sb.sb->nr_devices = nr_devs;
if (opts.version == bcachefs_metadata_version_current)
- sb.sb->features[0] |= BCH_SB_FEATURES_ALL;
+ sb.sb->features[0] |= cpu_to_le64(BCH_SB_FEATURES_ALL);
uuid_generate(sb.sb->uuid.b);