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

Commit 13d53a47 authored by Ethan Chen's avatar Ethan Chen
Browse files

fs_mgr: Allow ext2/3/4 to mount as ext4

Change-Id: Ic2d921239671d3035ca6dc0b2aa2cc3b197e7bc0
parent b08cf09c
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -363,9 +363,16 @@ int fs_mgr_mount_all(struct fstab *fstab)

        /* Skip fstab entries for partitions that we KNOW are wrong */
        detected_fs_type = blkid_get_tag_value(NULL, "TYPE", fstab->recs[i].blk_device);
        if (detected_fs_type && strcmp(fstab->recs[i].fs_type, detected_fs_type) != 0) {
        if (detected_fs_type) {
            int cmp_len = strlen(detected_fs_type);
            /* ext formats are mutually compatible by design */
            if (!strncmp(detected_fs_type,"ext", 3) && cmp_len == 4) {
                cmp_len = 3;
            }
            if (strncmp(fstab->recs[i].fs_type, detected_fs_type, cmp_len)) {
                continue;
            }
        }

        int last_idx_inspected;
        mret = mount_with_alternatives(fstab, i, &last_idx_inspected, &attempted_idx);