5110ad88cb
On large (blockcount > 32bit) filesystems reading directly super_block->s_blocks_count is not sufficient as the block count is held in 2 separate 32 bit variables. Instead always use the provided ext2fs_blocks_count to read the value. This can result in assertion failure, when the block count is only held in the high 32 bits, in this case s_block_counts would be zero, which would result in btrfs_convert_context::block_count/total_bytes to also be 0 and hit an assertion failure: convert/main.c:1162: do_convert: Assertion `cctx.total_bytes != 0` failed, value 0 btrfs-convert(+0xffb0)[0x557defdabfb0] btrfs-convert(main+0x6c5)[0x557defdaa125] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea)[0x7f66e1f8bd0a] btrfs-convert(_start+0x2a)[0x557defdab52a] Aborted What's worse it can also result in btrfs-convert mistakenly thinking that a filesystem is smaller than it actually is (ignoring the top 32 bits). Link: https://lore.kernel.org/linux-btrfs/023b5ca9-0610-231b-fc4e-a72fe1377a5a@jansson.tech/ Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
Makefile | ||
common.c | ||
common.h | ||
main.c | ||
source-ext2.c | ||
source-ext2.h | ||
source-fs.c | ||
source-fs.h | ||
source-reiserfs.c | ||
source-reiserfs.h |