Skip to content

Commit

Permalink
Merge pull request #32 from CyanogenMod/cm-12.0
Browse files Browse the repository at this point in the history
fs_mgr: Allow ext2/3/4 to mount as ext4
  • Loading branch information
percy-g2 committed Jan 29, 2015
2 parents 5b64f37 + 13d53a4 commit 7ce2c7e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions fs_mgr/fs_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,15 @@ 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) {
continue;
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;
Expand Down

0 comments on commit 7ce2c7e

Please sign in to comment.