mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 23:00:21 +00:00
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>
This commit is contained in:
parent
bb6bbf4a06
commit
120f63e321
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user