From: Karel Zak Date: Tue, 23 Nov 2010 11:21:12 +0000 (+0100) Subject: libmount: add new debug messages, fix umount return code X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21193a4890f29fb8e7b6361aa1e5288f874396b9;p=util-linux libmount: add new debug messages, fix umount return code Signed-off-by: Karel Zak --- 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);