From 84be704af44b89a25a5df14fa2b1fc814311542e Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 23 Aug 2016 13:48:50 -0600 Subject: [PATCH] DO NOT MERGE. Block adoptable storage when using FBE. For adoptable storage and FBE to coexist we need a new dm-biocrypt kernel feature which isn't ready yet. So for now, prevent devices from being adopted on FBE devices. Bug: 30770036 Change-Id: I47639209161ee403ce13ea9a60da235e97c3fc30 (cherry picked from commit 157175110948b3cf604e40420059aa5265039847) --- Disk.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Disk.cpp b/Disk.cpp index 2c2a2da..1e1a63e 100644 --- a/Disk.cpp +++ b/Disk.cpp @@ -21,6 +21,7 @@ #include "VolumeBase.h" #include "VolumeManager.h" #include "ResponseCode.h" +#include "Ext4Crypt.h" #include #include @@ -438,6 +439,11 @@ status_t Disk::partitionPrivate() { status_t Disk::partitionMixed(int8_t ratio) { int res; + if (e4crypt_is_native()) { + LOG(ERROR) << "Private volumes not yet supported on FBE devices"; + return -EINVAL; + } + destroyAllVolumes(); mJustPartitioned = true;