mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-22 21:43:35 +00:00
btrfs-progs: convert: make ASSERT not truncate cctx.total_bytes value
Commit "btrfs-progs: convert: prevent 32bit overflow for cctx->total_bytes" added an assert to ensure that cctxx.total_bytes did not overflow, but this ASSERT calls assert_trace, which expects a long value. By converting the u64 to long overflows in a 32bit machine, leading the assert_trace to be triggered since cctx.total_bytes turns to zero. Fix this problem by comparing the cctx.total_bytes with zero when calling ASSERT. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
c9c4eb1f3f
commit
e44adcc5bc
@ -1136,7 +1136,7 @@ static int do_convert(const char *devname, u32 convert_flags, u32 nodesize,
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
ASSERT(cctx.total_bytes);
|
||||
ASSERT(cctx.total_bytes != 0);
|
||||
blocksize = cctx.blocksize;
|
||||
total_bytes = (u64)blocksize * (u64)cctx.block_count;
|
||||
if (blocksize < 4096) {
|
||||
|
Loading…
Reference in New Issue
Block a user