summaryrefslogtreecommitdiffstats
path: root/fs_mgr
diff options
context:
space:
mode:
authorOreste Salerno <oreste.salerno@tomtom.com>2015-05-20 17:01:39 +0000
committerOreste Salerno <oreste.salerno@tomtom.com>2015-06-09 16:38:35 +0000
commit6ed84c986f906457e130b02768aab12f6751283b (patch)
tree55a38daa4624dc10a10ded410a0ecf399d1441c5 /fs_mgr
parent6af8e11f4cbb2ba895399dc0371471ff79f25665 (diff)
downloadsystem_core-6ed84c986f906457e130b02768aab12f6751283b.tar.gz
system_core-6ed84c986f906457e130b02768aab12f6751283b.tar.bz2
system_core-6ed84c986f906457e130b02768aab12f6751283b.zip
Only pass nomblk_io_submit option when mounting ext4
This option only exists for ext4 filesystems, so it shouldn't be used when mounting ext2/ext3. This bug would cause the mount system call in check_fs to always fail with ext2/ext3 filesystems. Change-Id: I3c8938029357a4a4170355118b6757f61ff4b227
Diffstat (limited to 'fs_mgr')
-rw-r--r--fs_mgr/fs_mgr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c
index bb2bed24e..42f25c7ee 100644
--- a/fs_mgr/fs_mgr.c
+++ b/fs_mgr/fs_mgr.c
@@ -95,7 +95,7 @@ static void check_fs(char *blk_device, char *fs_type, char *target)
int status;
int ret;
long tmpmnt_flags = MS_NOATIME | MS_NOEXEC | MS_NOSUID;
- char *tmpmnt_opts = "nomblk_io_submit,errors=remount-ro";
+ char tmpmnt_opts[64] = "errors=remount-ro";
char *e2fsck_argv[] = {
E2FSCK_BIN,
"-y",
@@ -118,6 +118,10 @@ static void check_fs(char *blk_device, char *fs_type, char *target)
* fix the filesystem.
*/
errno = 0;
+ if (!strcmp(fs_type, "ext4")) {
+ // This option is only valid with ext4
+ strlcat(tmpmnt_opts, ",nomblk_io_submit", sizeof(tmpmnt_opts));
+ }
ret = mount(blk_device, target, fs_type, tmpmnt_flags, tmpmnt_opts);
INFO("%s(): mount(%s,%s,%s)=%d: %s\n",
__func__, blk_device, target, fs_type, ret, strerror(errno));