Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f22626cd authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan
Browse files

recovery: only use vold format for exact path match

Otherwise when formatting /sdcard/.android_secure, it will be
matched to /sdcard and vold will format the entire /sdcard.

Change-Id: Ifc26121f982b391b4ccf582b6162ab76feb72cae
parent 0005c1e3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -340,7 +340,9 @@ int format_volume(const char* volume) {
        }
    }

    if (fs_mgr_is_voldmanaged(v)) {
    // Only use vold format for exact matches (otherwise /sdcard will be
    // formatted instead of /sdcard/.android_secure)
    if (fs_mgr_is_voldmanaged(v) && strcmp(volume, v->mount_point) == 0) {
        if (ensure_path_unmounted(volume) != 0) {
            LOGE("format_volume failed to unmount %s", v->mount_point);
        }