{
// Force filesystem check via fcsf might be able to avoid fail situation during encryption.
Ext4Tool ext4Source(source);
- ext4Source.forceCleanUp();
+
+ for (int retry = 0; retry < 32; retry++) {
+ try {
+ ext4Source.forceCleanUp();
+ } catch (runtime::Exception &e) {
+ continue;
+ }
+ break;
+ }
// create crypto type device mapping layer to mount the plain partition
// should be encrypted here.
// Force filesystem check via fcsf might be able to avoid fail situation during decryption.
Ext4Tool ext4CryptoBlkDev(cryptoBlkDev);
- ext4CryptoBlkDev.forceCleanUp();
+
+ for (int retry = 0; retry < 32; retry++) {
+ try {
+ ext4CryptoBlkDev.forceCleanUp();
+ } catch (runtime::Exception &e) {
+ continue;
+ }
+ break;
+ }
std::function<bool(blkcnt_t)> isTarget;
if (!(options & OPTION_INCLUDE_UNUSED_REGION)) {