[ext2fs] set a minimum ext partition size of 256 MB

* Not gonna bother with computing the effective minimum size so 256 MB will have to do.
* Closes #1576
This commit is contained in:
Pete Batard 2020-10-02 13:58:15 +01:00
parent 68a5a26956
commit e6ac3782fe
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
4 changed files with 21 additions and 7 deletions

View file

@ -500,7 +500,7 @@ static BOOL SetFileSystemAndClusterSize(char* fs_name)
SelectedDrive.ClusterSize[FS_UDF].Default = 1;
// ext2/ext3/ext4
if (advanced_mode_format) {
if (advanced_mode_format && (SelectedDrive.DiskSize >= MIN_EXT_SIZE)) {
SelectedDrive.ClusterSize[FS_EXT2].Allowed = SINGLE_CLUSTERSIZE_DEFAULT;
SelectedDrive.ClusterSize[FS_EXT2].Default = 1;
SelectedDrive.ClusterSize[FS_EXT3].Allowed = SINGLE_CLUSTERSIZE_DEFAULT;
@ -2280,6 +2280,16 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
static_sprintf(tmp, "0 (%s)", lmprintf(MSG_124));
app_changed_size = TRUE;
SetWindowTextU(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp);
} else if (persistence_size < MIN_EXT_SIZE) {
persistence_size = MIN_EXT_SIZE;
uint64_t pos = persistence_size / MB;
for (i = 0; i < persistence_unit_selection; i++)
pos /= 1024;
lPos = (LONG)pos;
SendMessage(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER), TBM_SETPOS, TRUE, lPos);
static_sprintf(tmp, "%ld", lPos);
app_changed_size = TRUE;
SetWindowTextU(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp);
}
}
break;