On Tue, Aug 27, 2019 at 06:33:02PM +0200, David Sterba wrote: > On Mon, Aug 26, 2019 at 01:48:43PM +0200, Johannes Thumshirn wrote: > > The callers of csum_tree_block_size() blindly assume we're only having > > crc32c as a possible checksum and thus pass in > > btrfs_csum_sizes[BTRFS_CSUM_TYPE_CRC32] for the size argument of > > csum_tree_block_size(). > > > > Signed-off-by: Johannes Thumshirn <jthumshirn@xxxxxxx> > > Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx> > > --- > > mkfs/common.c | 14 +++++++------- > > 1 file changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/mkfs/common.c b/mkfs/common.c > > index caca5e707233..b6e549b19272 100644 > > --- a/mkfs/common.c > > +++ b/mkfs/common.c > > @@ -101,7 +101,7 @@ static int btrfs_create_tree_root(int fd, struct btrfs_mkfs_config *cfg, > > } > > > > /* generate checksum */ > > - csum_tree_block_size(buf, btrfs_csum_sizes[BTRFS_CSUM_TYPE_CRC32], 0); > > + csum_tree_block_size(buf, btrfs_csum_sizes[cfg->csum_type], 0); > > Where is btrfs_mkfs_config::csum_type defined? Aha it's in 8/11.
