summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authornkk71 <nkk71x@gmail.com>2017-04-05 21:14:22 +0200
committerDees Troy <dees_troy@teamw.in>2017-05-23 14:59:57 +0200
commit5073003302f677a9b7de1436c6304f156603d322 (patch)
tree77f2c4b5222e19333e5adac16b1c351a0205a5cf /crypto
parentetc: remove "." from LD_LIBRARY_PATH (diff)
downloadandroid_bootable_recovery-5073003302f677a9b7de1436c6304f156603d322.tar
android_bootable_recovery-5073003302f677a9b7de1436c6304f156603d322.tar.gz
android_bootable_recovery-5073003302f677a9b7de1436c6304f156603d322.tar.bz2
android_bootable_recovery-5073003302f677a9b7de1436c6304f156603d322.tar.lz
android_bootable_recovery-5073003302f677a9b7de1436c6304f156603d322.tar.xz
android_bootable_recovery-5073003302f677a9b7de1436c6304f156603d322.tar.zst
android_bootable_recovery-5073003302f677a9b7de1436c6304f156603d322.zip
Diffstat (limited to 'crypto')
-rw-r--r--crypto/lollipop/cryptfs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/lollipop/cryptfs.c b/crypto/lollipop/cryptfs.c
index f0822063e..80f433bf6 100644
--- a/crypto/lollipop/cryptfs.c
+++ b/crypto/lollipop/cryptfs.c
@@ -1099,6 +1099,13 @@ static int create_crypto_blk_dev(struct crypt_mnt_ftr *crypt_ftr, const unsigned
fd, extra_params);
if (load_count < 0) {
printf("Cannot load dm-crypt mapping table.\n");
+
+ // Remove the dm-crypt device, otherwise it cannot be used later on by other
+ // processes (eg vold_decrypt) or further testing/debugging in recovery
+ ioctl_init(io, DM_CRYPT_BUF_SIZE, name, 0);
+ if (ioctl(fd, DM_DEV_REMOVE, io)) {
+ printf("Cannot remove dm-crypt device %i\n", errno);
+ }
goto errout;
} else if (load_count > 1) {
printf("Took %d tries to load dmcrypt table.\n", load_count);
@@ -1109,6 +1116,13 @@ static int create_crypto_blk_dev(struct crypt_mnt_ftr *crypt_ftr, const unsigned
if (ioctl(fd, DM_DEV_SUSPEND, io)) {
printf("Cannot resume the dm-crypt device\n");
+
+ // Remove the dm-crypt device, otherwise it cannot be used later on by other
+ // processes (eg vold_decrypt) or further testing/debugging in recovery
+ ioctl_init(io, DM_CRYPT_BUF_SIZE, name, 0);
+ if (ioctl(fd, DM_DEV_REMOVE, io)) {
+ printf("Cannot remove dm-crypt device %i\n", errno);
+ }
goto errout;
}