On 21/10/2020 13:23, Matthew Wilcox wrote: > - unsigned long newsize = roundup_pow_of_two(size); > + unsigned long newsize = size ? roundup_pow_of_two(size) : size; > > would fix the ubsan splat. Or maybe you should stop passing 0 to > get_init_ra_size()? ;-) You're right. Let's do both ;-). Fix btrfs to stop passing in 0 and get_init_ra_size() to not call roundup_pow_of_two() with 0.