aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/super-io.c
diff options
context:
space:
mode:
authorGravatar Janpieter Sollie <janpieter.sollie@edpnet.be> 2021-06-13 22:01:08 +0200
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:09:06 -0400
commit120f63e321fa9fdb1837dd64fcd50e2b144b0d6d (patch)
tree3aa9771e7a05ff2a5961ca8de75bcd5b7a71e16d /fs/bcachefs/super-io.c
parentbcachefs: Clear iter->should_be_locked in bch2_trans_reset (diff)
downloadlinux-120f63e321fa9fdb1837dd64fcd50e2b144b0d6d.tar.gz
linux-120f63e321fa9fdb1837dd64fcd50e2b144b0d6d.tar.bz2
linux-120f63e321fa9fdb1837dd64fcd50e2b144b0d6d.zip
bcachefs: fix a possible bcachefs checksum mapping error opt-checksum enum to type-checksum enum
This fixes some rare cases where the metadata checksum option specified may map to the wrong actual checksum type. Signed-off-by: Janpieter Sollie <janpieter.sollie@edpnet.be> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super-io.c')
-rw-r--r--fs/bcachefs/super-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c
index fc6fb302706a..403e77e2c515 100644
--- a/fs/bcachefs/super-io.c
+++ b/fs/bcachefs/super-io.c
@@ -684,7 +684,7 @@ static void write_one_super(struct bch_fs *c, struct bch_dev *ca, unsigned idx)
sb->offset = sb->layout.sb_offset[idx];
- SET_BCH_SB_CSUM_TYPE(sb, c->opts.metadata_checksum);
+ SET_BCH_SB_CSUM_TYPE(sb, bch2_csum_opt_to_type(c->opts.metadata_checksum, false));
sb->csum = csum_vstruct(c, BCH_SB_CSUM_TYPE(sb),
null_nonce(), sb);