Malloc Failure occurs in 32bit Windows, when using fastboot.exe flash the
f2fs sparse image filling with up to 2G chunk size.
Signed-off-by: Gao Ming <gaoming20@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
#endif
}
+#define MAX_CHUNK_SIZE (1 * 1024 * 1024 * 1024ULL)
int f2fs_finalize_device(void)
{
int i;
chunk_start = -1;
} else if (blocks[j] && chunk_start == -1) {
chunk_start = j;
+ } else if (blocks[j] && (chunk_start != -1) &&
+ (j + 1 - chunk_start >=
+ (MAX_CHUNK_SIZE / F2FS_BLKSIZE))) {
+ ret = sparse_merge_blocks(chunk_start,
+ j + 1 - chunk_start);
+ chunk_start = -1;
}
ASSERT(!ret);
}