blob: 794e1dd592dd85a7c0b1cc6fc60414e66ee418e6 [file] [log] [blame]
Jeff Sharkeydeb24052015-03-02 21:01:40 -08001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Jeff Sharkeydeb24052015-03-02 21:01:40 -080017#include "Disk.h"
18#include "PublicVolume.h"
Jeff Sharkey9c484982015-03-31 10:35:33 -070019#include "PrivateVolume.h"
Jeff Sharkeydeb24052015-03-02 21:01:40 -080020#include "Utils.h"
21#include "VolumeBase.h"
Jeff Sharkey36801cc2015-03-13 16:09:20 -070022#include "VolumeManager.h"
23#include "ResponseCode.h"
Jeff Sharkeydeb24052015-03-02 21:01:40 -080024
Dan Albertae9e8902015-03-16 10:35:17 -070025#include <base/file.h>
26#include <base/stringprintf.h>
Jeff Sharkey36801cc2015-03-13 16:09:20 -070027#include <base/logging.h>
Jeff Sharkeydeb24052015-03-02 21:01:40 -080028#include <diskconfig/diskconfig.h>
Jeff Sharkeydeb24052015-03-02 21:01:40 -080029
Jeff Sharkey9c484982015-03-31 10:35:33 -070030#include <vector>
Jeff Sharkeydeb24052015-03-02 21:01:40 -080031#include <fcntl.h>
Jeff Sharkey38cfc022015-03-30 21:22:07 -070032#include <inttypes.h>
Jeff Sharkeydeb24052015-03-02 21:01:40 -080033#include <stdio.h>
34#include <stdlib.h>
35#include <sys/types.h>
36#include <sys/stat.h>
37#include <sys/mount.h>
38
Dan Albertae9e8902015-03-16 10:35:17 -070039using android::base::ReadFileToString;
Jeff Sharkey9c484982015-03-31 10:35:33 -070040using android::base::WriteStringToFile;
Dan Albertae9e8902015-03-16 10:35:17 -070041using android::base::StringPrintf;
42
Jeff Sharkeydeb24052015-03-02 21:01:40 -080043namespace android {
44namespace vold {
45
46static const char* kSgdiskPath = "/system/bin/sgdisk";
47static const char* kSgdiskToken = " \t\n";
48
49static const char* kSysfsMmcMaxMinors = "/sys/module/mmcblk/parameters/perdev_minors";
50
51static const unsigned int kMajorBlockScsi = 8;
52static const unsigned int kMajorBlockMmc = 179;
53
54static const char* kGptBasicData = "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7";
55static const char* kGptAndroidMeta = "19A710A2-B3CA-11E4-B026-10604B889DCF";
Jeff Sharkeyce6a9132015-04-08 21:07:21 -070056static const char* kGptAndroidExpand = "193D1EA4-B3CA-11E4-B075-10604B889DCF";
Jeff Sharkeydeb24052015-03-02 21:01:40 -080057
Jeff Sharkey9c484982015-03-31 10:35:33 -070058static const char* kKeyPath = "/data/misc/vold";
59
Jeff Sharkeydeb24052015-03-02 21:01:40 -080060enum class Table {
61 kUnknown,
62 kMbr,
63 kGpt,
64};
65
Jeff Sharkeyce6a9132015-04-08 21:07:21 -070066Disk::Disk(const std::string& eventPath, dev_t device,
67 const std::string& nickname, int flags) :
68 mDevice(device), mSize(-1), mNickname(nickname), mFlags(flags), mCreated(
69 false), mJustPartitioned(false) {
Jeff Sharkey36801cc2015-03-13 16:09:20 -070070 mId = StringPrintf("disk:%u,%u", major(device), minor(device));
71 mEventPath = eventPath;
Jeff Sharkeydeb24052015-03-02 21:01:40 -080072 mSysPath = StringPrintf("/sys/%s", eventPath.c_str());
Jeff Sharkey36801cc2015-03-13 16:09:20 -070073 mDevPath = StringPrintf("/dev/block/vold/%s", mId.c_str());
Jeff Sharkeydeb24052015-03-02 21:01:40 -080074 CreateDeviceNode(mDevPath, mDevice);
75}
76
77Disk::~Disk() {
Jeff Sharkey36801cc2015-03-13 16:09:20 -070078 CHECK(!mCreated);
Jeff Sharkeydeb24052015-03-02 21:01:40 -080079 DestroyDeviceNode(mDevPath);
80}
81
82std::shared_ptr<VolumeBase> Disk::findVolume(const std::string& id) {
Jeff Sharkey36801cc2015-03-13 16:09:20 -070083 for (auto vol : mVolumes) {
84 if (vol->getId() == id) {
85 return vol;
86 }
87 auto stackedVol = vol->findVolume(id);
88 if (stackedVol != nullptr) {
89 return stackedVol;
Jeff Sharkeydeb24052015-03-02 21:01:40 -080090 }
91 }
92 return nullptr;
93}
94
Jeff Sharkey36801cc2015-03-13 16:09:20 -070095status_t Disk::create() {
96 CHECK(!mCreated);
97 mCreated = true;
Jeff Sharkeyce6a9132015-04-08 21:07:21 -070098 notifyEvent(ResponseCode::DiskCreated, StringPrintf("%d", mFlags));
Jeff Sharkey36801cc2015-03-13 16:09:20 -070099 readMetadata();
100 readPartitions();
101 return OK;
102}
103
104status_t Disk::destroy() {
105 CHECK(mCreated);
106 destroyAllVolumes();
107 mCreated = false;
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700108 notifyEvent(ResponseCode::DiskDestroyed);
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700109 return OK;
110}
111
Jeff Sharkey9c484982015-03-31 10:35:33 -0700112static std::string BuildKeyPath(const std::string& partGuid) {
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700113 return StringPrintf("%s/expand_%s.key", kKeyPath, partGuid.c_str());
Jeff Sharkey9c484982015-03-31 10:35:33 -0700114}
115
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700116void Disk::createPublicVolume(dev_t device) {
Jeff Sharkey9c484982015-03-31 10:35:33 -0700117 auto vol = std::shared_ptr<VolumeBase>(new PublicVolume(device));
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700118 if (mJustPartitioned) {
119 LOG(DEBUG) << "Device just partitioned; silently formatting";
120 vol->setSilent(true);
121 vol->create();
122 vol->format();
123 vol->destroy();
124 vol->setSilent(false);
125 }
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700126
Jeff Sharkey9c484982015-03-31 10:35:33 -0700127 mVolumes.push_back(vol);
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700128 vol->create();
129 notifyEvent(ResponseCode::DiskVolumeCreated, vol->getId());
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700130}
131
Jeff Sharkey9c484982015-03-31 10:35:33 -0700132void Disk::createPrivateVolume(dev_t device, const std::string& partGuid) {
133 std::string tmp;
134 std::string normalizedGuid;
135 if (HexToStr(partGuid, tmp)) {
136 LOG(WARNING) << "Invalid GUID " << partGuid;
137 return;
138 }
139 StrToHex(tmp, normalizedGuid);
140
141 std::string keyRaw;
142 if (!ReadFileToString(BuildKeyPath(normalizedGuid), &keyRaw)) {
143 PLOG(ERROR) << "Failed to load key for GUID " << normalizedGuid;
144 return;
145 }
146
147 LOG(DEBUG) << "Found key for GUID " << normalizedGuid;
148
149 auto vol = std::shared_ptr<VolumeBase>(new PrivateVolume(device, keyRaw));
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700150 if (mJustPartitioned) {
151 LOG(DEBUG) << "Device just partitioned; silently formatting";
152 vol->setSilent(true);
153 vol->create();
154 vol->format();
155 vol->destroy();
156 vol->setSilent(false);
157 }
Jeff Sharkey9c484982015-03-31 10:35:33 -0700158
159 mVolumes.push_back(vol);
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700160 vol->create();
161 notifyEvent(ResponseCode::DiskVolumeCreated, vol->getId());
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700162}
163
164void Disk::destroyAllVolumes() {
165 for (auto vol : mVolumes) {
166 vol->destroy();
167 }
168 mVolumes.clear();
169}
170
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800171status_t Disk::readMetadata() {
172 mSize = -1;
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700173 mLabel.clear();
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800174
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700175 int fd = open(mDevPath.c_str(), O_RDONLY | O_CLOEXEC);
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700176 if (fd != -1) {
177 if (ioctl(fd, BLKGETSIZE64, &mSize)) {
178 mSize = -1;
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800179 }
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700180 close(fd);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800181 }
182
183 switch (major(mDevice)) {
184 case kMajorBlockScsi: {
185 std::string path(mSysPath + "/device/vendor");
186 std::string tmp;
187 if (!ReadFileToString(path, &tmp)) {
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700188 PLOG(WARNING) << "Failed to read vendor from " << path;
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800189 return -errno;
190 }
191 mLabel = tmp;
192 break;
193 }
194 case kMajorBlockMmc: {
195 std::string path(mSysPath + "/device/manfid");
196 std::string tmp;
197 if (!ReadFileToString(path, &tmp)) {
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700198 PLOG(WARNING) << "Failed to read manufacturer from " << path;
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800199 return -errno;
200 }
201 uint64_t manfid = strtoll(tmp.c_str(), nullptr, 16);
202 // Our goal here is to give the user a meaningful label, ideally
203 // matching whatever is silk-screened on the card. To reduce
204 // user confusion, this list doesn't contain white-label manfid.
205 switch (manfid) {
206 case 0x000003: mLabel = "SanDisk"; break;
207 case 0x00001b: mLabel = "Samsung"; break;
208 case 0x000028: mLabel = "Lexar"; break;
209 case 0x000074: mLabel = "Transcend"; break;
210 }
211 break;
212 }
213 default: {
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700214 LOG(WARNING) << "Unsupported block major type" << major(mDevice);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800215 return -ENOTSUP;
216 }
217 }
218
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700219 notifyEvent(ResponseCode::DiskSizeChanged, StringPrintf("%" PRId64, mSize));
220 notifyEvent(ResponseCode::DiskLabelChanged, mLabel);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800221 return OK;
222}
223
224status_t Disk::readPartitions() {
225 int8_t maxMinors = getMaxMinors();
226 if (maxMinors < 0) {
227 return -ENOTSUP;
228 }
229
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700230 destroyAllVolumes();
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800231
232 // Parse partition table
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700233
234 std::vector<std::string> cmd;
235 cmd.push_back(kSgdiskPath);
236 cmd.push_back("--android-dump");
237 cmd.push_back(mDevPath);
238
239 std::vector<std::string> output;
240 status_t res = ForkExecvp(cmd, output);
241 if (res != OK) {
242 LOG(WARNING) << "sgdisk failed to scan " << mDevPath;
243 mJustPartitioned = false;
244 return res;
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800245 }
246
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800247 Table table = Table::kUnknown;
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700248 bool foundParts = false;
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700249 for (auto line : output) {
250 char* cline = (char*) line.c_str();
251 char* token = strtok(cline, kSgdiskToken);
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700252 if (token == nullptr) continue;
253
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800254 if (!strcmp(token, "DISK")) {
255 const char* type = strtok(nullptr, kSgdiskToken);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800256 if (!strcmp(type, "mbr")) {
257 table = Table::kMbr;
258 } else if (!strcmp(type, "gpt")) {
259 table = Table::kGpt;
260 }
261 } else if (!strcmp(token, "PART")) {
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700262 foundParts = true;
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800263 int i = strtol(strtok(nullptr, kSgdiskToken), nullptr, 10);
264 if (i <= 0 || i > maxMinors) {
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700265 LOG(WARNING) << mId << " is ignoring partition " << i
266 << " beyond max supported devices";
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800267 continue;
268 }
269 dev_t partDevice = makedev(major(mDevice), minor(mDevice) + i);
270
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800271 if (table == Table::kMbr) {
272 const char* type = strtok(nullptr, kSgdiskToken);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800273
274 switch (strtol(type, nullptr, 16)) {
275 case 0x06: // FAT16
276 case 0x0b: // W95 FAT32 (LBA)
277 case 0x0c: // W95 FAT32 (LBA)
278 case 0x0e: // W95 FAT16 (LBA)
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700279 createPublicVolume(partDevice);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800280 break;
281 }
282 } else if (table == Table::kGpt) {
283 const char* typeGuid = strtok(nullptr, kSgdiskToken);
284 const char* partGuid = strtok(nullptr, kSgdiskToken);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800285
286 if (!strcasecmp(typeGuid, kGptBasicData)) {
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700287 createPublicVolume(partDevice);
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700288 } else if (!strcasecmp(typeGuid, kGptAndroidExpand)) {
Jeff Sharkey9c484982015-03-31 10:35:33 -0700289 createPrivateVolume(partDevice, partGuid);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800290 }
291 }
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800292 }
293 }
294
295 // Ugly last ditch effort, treat entire disk as partition
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700296 if (table == Table::kUnknown || !foundParts) {
297 LOG(WARNING) << mId << " has unknown partition table; trying entire device";
298 createPublicVolume(mDevice);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800299 }
300
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700301 mJustPartitioned = false;
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800302 return OK;
303}
304
Jeff Sharkey9c484982015-03-31 10:35:33 -0700305status_t Disk::unmountAll() {
306 for (auto vol : mVolumes) {
307 vol->unmount();
308 }
309 return OK;
310}
311
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800312status_t Disk::partitionPublic() {
313 // TODO: improve this code
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700314 destroyAllVolumes();
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700315 mJustPartitioned = true;
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800316
317 struct disk_info dinfo;
318 memset(&dinfo, 0, sizeof(dinfo));
319
320 if (!(dinfo.part_lst = (struct part_info *) malloc(
321 MAX_NUM_PARTS * sizeof(struct part_info)))) {
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800322 return -1;
323 }
324
325 memset(dinfo.part_lst, 0, MAX_NUM_PARTS * sizeof(struct part_info));
326 dinfo.device = strdup(mDevPath.c_str());
327 dinfo.scheme = PART_SCHEME_MBR;
328 dinfo.sect_size = 512;
329 dinfo.skip_lba = 2048;
330 dinfo.num_lba = 0;
331 dinfo.num_parts = 1;
332
333 struct part_info *pinfo = &dinfo.part_lst[0];
334
335 pinfo->name = strdup("android_sdcard");
336 pinfo->flags |= PART_ACTIVE_FLAG;
337 pinfo->type = PC_PART_TYPE_FAT32;
338 pinfo->len_kb = -1;
339
340 int rc = apply_disk_config(&dinfo, 0);
341 if (rc) {
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700342 LOG(ERROR) << "Failed to apply disk configuration: " << rc;
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800343 goto out;
344 }
345
346out:
347 free(pinfo->name);
348 free(dinfo.device);
349 free(dinfo.part_lst);
350
351 return rc;
352}
353
354status_t Disk::partitionPrivate() {
Jeff Sharkey9c484982015-03-31 10:35:33 -0700355 return partitionMixed(0);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800356}
357
358status_t Disk::partitionMixed(int8_t ratio) {
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700359 int res;
Jeff Sharkey9c484982015-03-31 10:35:33 -0700360
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700361 destroyAllVolumes();
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700362 mJustPartitioned = true;
Jeff Sharkey9c484982015-03-31 10:35:33 -0700363
364 // First nuke any existing partition table
365 std::vector<std::string> cmd;
366 cmd.push_back(kSgdiskPath);
367 cmd.push_back("--zap-all");
368 cmd.push_back(mDevPath);
369
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700370 if ((res = ForkExecvp(cmd)) != 0) {
371 LOG(ERROR) << "Failed to zap; status " << res;
372 return res;
Jeff Sharkey9c484982015-03-31 10:35:33 -0700373 }
374
375 // We've had some success above, so generate both the private partition
376 // GUID and encryption key and persist them.
377 std::string partGuidRaw;
378 std::string keyRaw;
379 if (ReadRandomBytes(16, partGuidRaw) || ReadRandomBytes(16, keyRaw)) {
380 LOG(ERROR) << "Failed to generate GUID or key";
381 return -EIO;
382 }
383
384 std::string partGuid;
385 StrToHex(partGuidRaw, partGuid);
386
387 if (!WriteStringToFile(keyRaw, BuildKeyPath(partGuid))) {
388 LOG(ERROR) << "Failed to persist key";
389 return -EIO;
390 } else {
391 LOG(DEBUG) << "Persisted key for GUID " << partGuid;
392 }
393
394 // Now let's build the new GPT table. We heavily rely on sgdisk to
395 // force optimal alignment on the created partitions.
396 cmd.clear();
397 cmd.push_back(kSgdiskPath);
398
399 // If requested, create a public partition first. Mixed-mode partitioning
400 // like this is an experimental feature.
401 if (ratio > 0) {
402 if (ratio < 10 || ratio > 90) {
403 LOG(ERROR) << "Mixed partition ratio must be between 10-90%";
404 return -EINVAL;
405 }
406
407 uint64_t splitMb = ((mSize / 100) * ratio) / 1024 / 1024;
408 cmd.push_back(StringPrintf("--new=0:0:+%" PRId64 "M", splitMb));
409 cmd.push_back(StringPrintf("--typecode=0:%s", kGptBasicData));
410 cmd.push_back("--change-name=0:shared");
411 }
412
413 // Define a metadata partition which is designed for future use; there
414 // should only be one of these per physical device, even if there are
415 // multiple private volumes.
416 cmd.push_back("--new=0:0:+16M");
417 cmd.push_back(StringPrintf("--typecode=0:%s", kGptAndroidMeta));
418 cmd.push_back("--change-name=0:android_meta");
419
420 // Define a single private partition filling the rest of disk.
421 cmd.push_back("--new=0:0:-0");
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700422 cmd.push_back(StringPrintf("--typecode=0:%s", kGptAndroidExpand));
Jeff Sharkey9c484982015-03-31 10:35:33 -0700423 cmd.push_back(StringPrintf("--partition-guid=0:%s", partGuid.c_str()));
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700424 cmd.push_back("--change-name=0:android_expand");
Jeff Sharkey9c484982015-03-31 10:35:33 -0700425
426 cmd.push_back(mDevPath);
427
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700428 if ((res = ForkExecvp(cmd)) != 0) {
429 LOG(ERROR) << "Failed to partition; status " << res;
430 return res;
Jeff Sharkey9c484982015-03-31 10:35:33 -0700431 }
432
433 return OK;
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800434}
435
Jeff Sharkeyce6a9132015-04-08 21:07:21 -0700436void Disk::notifyEvent(int event) {
437 VolumeManager::Instance()->getBroadcaster()->sendBroadcast(event,
438 getId().c_str(), false);
439}
440
441void Disk::notifyEvent(int event, const std::string& value) {
442 VolumeManager::Instance()->getBroadcaster()->sendBroadcast(event,
443 StringPrintf("%s %s", getId().c_str(), value.c_str()).c_str(), false);
444}
445
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800446int Disk::getMaxMinors() {
447 // Figure out maximum partition devices supported
448 switch (major(mDevice)) {
449 case kMajorBlockScsi: {
450 // Per Documentation/devices.txt this is static
451 return 15;
452 }
453 case kMajorBlockMmc: {
454 // Per Documentation/devices.txt this is dynamic
455 std::string tmp;
456 if (!ReadFileToString(kSysfsMmcMaxMinors, &tmp)) {
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700457 LOG(ERROR) << "Failed to read max minors";
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800458 return -errno;
459 }
460 return atoi(tmp.c_str());
461 }
462 }
463
Jeff Sharkey36801cc2015-03-13 16:09:20 -0700464 LOG(ERROR) << "Unsupported block major type " << major(mDevice);
Jeff Sharkeydeb24052015-03-02 21:01:40 -0800465 return -ENOTSUP;
466}
467
468} // namespace vold
469} // namespace android