When ext2fs_block_iterate2() is called on an extent-mapped file with a
depth > 1, it will erroneously calling the callback function starting
all over again with an offset of logical block 0. It shouldn't do
this, and it cases mke2fs to become very slow when creating files with
very large journals.
Fix this.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ctx.errcode = 0;
if (!(flags & BLOCK_FLAG_APPEND))
break;
+ next_block_set:
blk = 0;
r = (*ctx.func)(fs, &blk, blockcnt,
0, 0, priv_data);
(blk64_t) blk, 0);
if (ctx.errcode || (ret & BLOCK_ABORT))
break;
- continue;
+ if (blk)
+ goto next_block_set;
}
break;
}