diff options
| author | William Roberts <wroberts@tresys.com> | 2014-01-14 14:33:44 -0500 |
|---|---|---|
| committer | William Roberts <wroberts@tresys.com> | 2014-01-15 13:26:26 -0500 |
| commit | 071f28ae0e6dc55e13303282b185c76b23ff1c3a (patch) | |
| tree | 05fc02feb7b1545612863fbc589b9b7162ac550f /fs_mgr | |
| parent | 37fd839fc26b9b3da451a3cb23da6e49c6b676d9 (diff) | |
| download | system_core-071f28ae0e6dc55e13303282b185c76b23ff1c3a.tar.gz system_core-071f28ae0e6dc55e13303282b185c76b23ff1c3a.tar.bz2 system_core-071f28ae0e6dc55e13303282b185c76b23ff1c3a.zip | |
fs_mgr: increase verboseness on mount errors
While debugging a mount error, the dmesg output was less
than ideal. The error would be declared but why the mount
failed, and what options were passed was not present. This
patch ensures that the mount options and underlying
errno are printed.
Change-Id: I2b3a2c113149df878c0a8a10ef86fd9e4f909658
Diffstat (limited to 'fs_mgr')
| -rw-r--r-- | fs_mgr/fs_mgr.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c index 6d9d20c55..24ce806df 100644 --- a/fs_mgr/fs_mgr.c +++ b/fs_mgr/fs_mgr.c @@ -517,6 +517,7 @@ int fs_mgr_mount_all(struct fstab *fstab) int encrypted = 0; int ret = -1; int mret; + int mount_errno; if (!fstab) { return ret; @@ -560,6 +561,9 @@ int fs_mgr_mount_all(struct fstab *fstab) continue; } + /* back up errno as partition_wipe clobbers the value */ + mount_errno = errno; + /* mount(2) returned an error, check if it's encrypted and deal with it */ if ((fstab->recs[i].fs_mgr_flags & MF_CRYPT) && !partition_wiped(fstab->recs[i].blk_device)) { @@ -568,14 +572,16 @@ int fs_mgr_mount_all(struct fstab *fstab) */ if (mount("tmpfs", fstab->recs[i].mount_point, "tmpfs", MS_NOATIME | MS_NOSUID | MS_NODEV, CRYPTO_TMPFS_OPTIONS) < 0) { - ERROR("Cannot mount tmpfs filesystem for encrypted fs at %s\n", - fstab->recs[i].mount_point); + ERROR("Cannot mount tmpfs filesystem for encrypted fs at %s error: %s\n", + fstab->recs[i].mount_point, strerror(errno)); goto out; } encrypted = 1; } else { - ERROR("Cannot mount filesystem on %s at %s\n", - fstab->recs[i].blk_device, fstab->recs[i].mount_point); + ERROR("Failed to mount an un-encryptable or wiped partition on" + "%s at %s options: %s error: %s\n", + fstab->recs[i].blk_device, fstab->recs[i].mount_point, + fstab->recs[i].fs_options, strerror(mount_errno)); goto out; } } @@ -644,8 +650,8 @@ int fs_mgr_do_mount(struct fstab *fstab, char *n_name, char *n_blk_device, } if (__mount(n_blk_device, m, fstab->recs[i].fs_type, fstab->recs[i].flags, fstab->recs[i].fs_options)) { - ERROR("Cannot mount filesystem on %s at %s\n", - n_blk_device, m); + ERROR("Cannot mount filesystem on %s at %s options: %s error: %s\n", + n_blk_device, m, fstab->recs[i].fs_options, strerror(errno)); goto out; } else { ret = 0; |
