mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fatfs_corrupted_assert' into 'master'
fatfs: handle FR_INT_ERR as "filesystem corrupted" Closes IDF-894 See merge request espressif/esp-idf!5912
This commit is contained in:
commit
ee269ed687
@ -242,9 +242,7 @@ static int fresult_to_errno(FRESULT fr)
|
|||||||
{
|
{
|
||||||
switch(fr) {
|
switch(fr) {
|
||||||
case FR_DISK_ERR: return EIO;
|
case FR_DISK_ERR: return EIO;
|
||||||
case FR_INT_ERR:
|
case FR_INT_ERR: return EIO;
|
||||||
assert(0 && "fatfs internal error");
|
|
||||||
return EIO;
|
|
||||||
case FR_NOT_READY: return ENODEV;
|
case FR_NOT_READY: return ENODEV;
|
||||||
case FR_NO_FILE: return ENOENT;
|
case FR_NO_FILE: return ENOENT;
|
||||||
case FR_NO_PATH: return ENOENT;
|
case FR_NO_PATH: return ENOENT;
|
||||||
|
@ -111,7 +111,8 @@ esp_err_t esp_vfs_fat_sdmmc_mount(const char* base_path,
|
|||||||
if (res != FR_OK) {
|
if (res != FR_OK) {
|
||||||
err = ESP_FAIL;
|
err = ESP_FAIL;
|
||||||
ESP_LOGW(TAG, "failed to mount card (%d)", res);
|
ESP_LOGW(TAG, "failed to mount card (%d)", res);
|
||||||
if (!(res == FR_NO_FILESYSTEM && mount_config->format_if_mount_failed)) {
|
if (!((res == FR_NO_FILESYSTEM || res == FR_INT_ERR)
|
||||||
|
&& mount_config->format_if_mount_failed)) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
ESP_LOGW(TAG, "partitioning card");
|
ESP_LOGW(TAG, "partitioning card");
|
||||||
|
@ -76,7 +76,8 @@ esp_err_t esp_vfs_fat_spiflash_mount(const char* base_path,
|
|||||||
FRESULT fresult = f_mount(fs, drv, 1);
|
FRESULT fresult = f_mount(fs, drv, 1);
|
||||||
if (fresult != FR_OK) {
|
if (fresult != FR_OK) {
|
||||||
ESP_LOGW(TAG, "f_mount failed (%d)", fresult);
|
ESP_LOGW(TAG, "f_mount failed (%d)", fresult);
|
||||||
if (!(fresult == FR_NO_FILESYSTEM && mount_config->format_if_mount_failed)) {
|
if (!((fresult == FR_NO_FILESYSTEM || fresult == FR_INT_ERR)
|
||||||
|
&& mount_config->format_if_mount_failed)) {
|
||||||
result = ESP_FAIL;
|
result = ESP_FAIL;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user