'esp-idf esp32 spiffs suddenly failed

what can cause spiffs suddenly failed in esp-idf? It was ok during start up. Until certain time it failed. After reboot again it become ok again.

Failed mean when I try to open the file for read it return null.

FILE* f = fopen(filePath, "r");
if (f == NULL)
{
    ESP_LOGE(TAG, "Failed to open file for reading");
    return;
}

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source