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 {
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"));
-cxt->syscall_status));
return -cxt->syscall_status;
}
+ cxt->syscall_status = 0;
DBG(CXT, mnt_debug_h(cxt, "umount(2) success"));
return 0;
}
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);