mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-20 18:05:21 -04:00
[ext2fs] check for the maximum ext2/ext3 volume size
* Suggested by Marcos Mello * Closes #1524
This commit is contained in:
parent
8a59238022
commit
083b3db34c
2 changed files with 13 additions and 5 deletions
|
@ -312,6 +312,14 @@ BOOL FormatExtFs(DWORD DriveIndex, uint64_t PartitionOffset, DWORD BlockSize, LP
|
|||
features.s_log_cluster_size = features.s_log_block_size;
|
||||
size /= BlockSize;
|
||||
|
||||
// ext2 and ext3 have a can only accomodate up to Blocksize * 2^32 sized volumes
|
||||
if (((strcmp(FSName, FileSystemLabel[FS_EXT2]) == 0) || (strcmp(FSName, FileSystemLabel[FS_EXT3]) == 0)) &&
|
||||
(size >= 0x100000000ULL)) {
|
||||
FormatStatus = ext2_last_winerror(ERROR_INVALID_VOLUME_SIZE);
|
||||
uprintf("Volume size is too large for ext2 or ext3");
|
||||
goto out;
|
||||
}
|
||||
|
||||
// Set the blocks, reserved blocks and inodes
|
||||
ext2fs_blocks_count_set(&features, size);
|
||||
ext2fs_r_blocks_count_set(&features, (blk64_t)(reserve_ratio * size));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue