summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2012-04-19 10:50:22 +0200
committercodeworkx <daniel.hillenbrand@codeworkx.de>2012-04-19 10:50:22 +0200
commiteda64d531e882c46baf88d41a8d3a04874a795e6 (patch)
tree1f8d5ce96086e3c1f30a26b90899990d05d52aa5
parent55f61b6b5776b186899e8d0ebb51b8afdb28cb82 (diff)
downloadandroid_system_vold-ics.tar.gz
android_system_vold-ics.tar.bz2
android_system_vold-ics.zip
vold: fix handling of discs with multiple majors on DirectVolume::getShareDevice()ics-releaseicscm-9.1.0
The method DirectVolume::getShareDevice() returns an invalid device if the partition referenced by mPartIdx is bad. A bad partition is one where the major/minor numbers on disk don't match what is expected. The original major number is stored for bad partitions so the fix attempts to retrieve it and return it if applicable. This fix is one part of fixing ICS encryption on the i777 (and possibly other devices) where bad partitions may exist. Change-Id: Ic3b05dbf45315bde502c151f53928ca1891483f0
-rw-r--r--DirectVolume.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/DirectVolume.cpp b/DirectVolume.cpp
index fab7c12..e463446 100644
--- a/DirectVolume.cpp
+++ b/DirectVolume.cpp
@@ -72,6 +72,14 @@ dev_t DirectVolume::getDiskDevice() {
dev_t DirectVolume::getShareDevice() {
if (mPartIdx != -1) {
+#ifdef VOLD_DISC_HAS_MULTIPLE_MAJORS
+ int major = getMajorNumberForBadPartition(mPartIdx);
+ if(major != -1) {
+ SLOGE("getShareDevice() returning correct major: %d, minor: %d", major, mPartMinors[mPartIdx - 1]);
+ return MKDEV(major, mPartMinors[mPartIdx - 1]);
+ }
+ else
+#endif
return MKDEV(mDiskMajor, mPartIdx);
} else {
return MKDEV(mDiskMajor, mDiskMinor);