summaryrefslogtreecommitdiff
path: root/shlibs
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2010-11-23 12:21:12 +0100
committerKarel Zak <kzak@redhat.com>2011-01-03 12:28:46 +0100
commit21193a4890f29fb8e7b6361aa1e5288f874396b9 (patch)
treeed152b42c84a00bfb4f6d7880a02e851b5afda18 /shlibs
parent932d154c8d8adeb1acf23d7a637fc7c18dd29d83 (diff)
downloadutil-linux-old-21193a4890f29fb8e7b6361aa1e5288f874396b9.tar.gz
libmount: add new debug messages, fix umount return code
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs')
-rw-r--r--shlibs/mount/src/context.c17
-rw-r--r--shlibs/mount/src/context_umount.c5
2 files changed, 18 insertions, 4 deletions
diff --git a/shlibs/mount/src/context.c b/shlibs/mount/src/context.c
index 3ab5a737..923d7191 100644
--- a/shlibs/mount/src/context.c
+++ b/shlibs/mount/src/context.c
@@ -1079,13 +1079,22 @@ int mnt_context_update_tabs(mnt_context *cxt)
assert(cxt);
- if ((cxt->flags & MNT_FL_NOMTAB) && cxt->helper)
+ if (cxt->flags & MNT_FL_NOMTAB) {
+ DBG(CXT, mnt_debug_h(cxt, "don't update: NOMTAB flag"));
return 0;
- if (!cxt->update || !mnt_update_is_ready(cxt->update))
+ }
+ if (cxt->helper) {
+ DBG(CXT, mnt_debug_h(cxt, "don't update: external helper"));
return 0;
- if (cxt->syscall_status)
+ }
+ if (!cxt->update || !mnt_update_is_ready(cxt->update)) {
+ DBG(CXT, mnt_debug_h(cxt, "don't update: no update prepared"));
return 0;
-
+ }
+ if (cxt->syscall_status) {
+ DBG(CXT, mnt_debug_h(cxt, "don't update: syscall failed"));
+ return 0;
+ }
if (mnt_update_is_userspace_only(cxt->update))
filename = cxt->utab_path;
else {
diff --git a/shlibs/mount/src/context_umount.c b/shlibs/mount/src/context_umount.c
index 87a0bc8e..00bad109 100644
--- a/shlibs/mount/src/context_umount.c
+++ b/shlibs/mount/src/context_umount.c
@@ -31,6 +31,8 @@ static int lookup_umount_fs(mnt_context *cxt)
assert(cxt);
assert(cxt->fs);
+ DBG(CXT, mnt_debug_h(cxt, "umount: lookup FS"));
+
tgt = mnt_fs_get_target(cxt->fs);
if (!tgt) {
DBG(CXT, mnt_debug_h(cxt, "umount: undefined target"));
@@ -409,6 +411,7 @@ static int do_umount(mnt_context *cxt)
-cxt->syscall_status));
return -cxt->syscall_status;
}
+ cxt->syscall_status = 0;
DBG(CXT, mnt_debug_h(cxt, "umount(2) success"));
return 0;
}
@@ -474,6 +477,8 @@ int mnt_context_do_umount(mnt_context *cxt)
const char *o = mnt_fs_get_optstr(cxt->fs);
char *n = o ? strdup(o) : NULL;
+ DBG(CXT, mnt_debug_h(cxt, "fix remount-on-umount update"));
+
if (n)
mnt_optstr_remove_option(&n, "rw");
rc = mnt_optstr_prepend_option(&n, "ro", NULL);