Update engine state only if cryto device is properly created 82/195482/2 accepted/tizen/4.0/unified/20190101.230229 submit/tizen_4.0/20181227.012625
authorJaemin Ryu <jm77.ryu@samsung.com>
Fri, 14 Dec 2018 01:26:37 +0000 (10:26 +0900)
committerJaemin Ryu <jm77.ryu@samsung.com>
Thu, 27 Dec 2018 01:01:31 +0000 (10:01 +0900)
Change-Id: I1d3c9d11932afa22a2b7ea2dc101eba36ec39cf7
Signed-off-by: Jaemin Ryu <jm77.ryu@samsung.com>
server/engine/encryption/dmcrypt-engine.cpp

index 4fbba93..a9f272b 100644 (file)
@@ -356,11 +356,12 @@ void DMCryptEngine::decrypt(const BinaryData &key, unsigned int options)
        // create crypto type device mapping layer to mount the plain partition
        // should be encrypted here.
        auto cryptoBlkDev = createCryptoBlkDev(source, DM_DEFAULT_LABEL_NAME, sanitizeKey(key), DM_DEFAULT_CRYPTO_NAME);
-       start = true;
 
        // Force filesystem check via fcsf might be able to avoid fail situation during decryption.
        Ext4Tool ext4CryptoBlkDev(cryptoBlkDev);
 
+       start = true;
+
        for (int retry = 0; retry < 32; retry++) {
                try {
                        ext4CryptoBlkDev.forceCleanUp();