]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: don't prepare update if syscall failed
authorKarel Zak <kzak@redhat.com>
Mon, 7 Feb 2011 14:15:30 +0000 (15:15 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 7 Feb 2011 14:15:30 +0000 (15:15 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/mount/src/context.c

index 23cb4b9941a040665efd6bd05d9adb10672fdfa7..a481d9cb8a04aefe09f629c240f7b7cd9ba0074e 100644 (file)
@@ -1230,6 +1230,8 @@ int mnt_context_prepare_update(struct libmnt_context *cxt)
        assert(cxt->action);
        assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
 
+       DBG(CXT, mnt_debug_h(cxt, "prepare update"));
+
        if (cxt->mountflags & MS_PROPAGATION) {
                DBG(CXT, mnt_debug_h(cxt, "skip update: MS_PROPAGATION"));
                return 0;
@@ -1253,6 +1255,13 @@ int mnt_context_prepare_update(struct libmnt_context *cxt)
                DBG(CXT, mnt_debug_h(cxt, "skip update: no writable destination"));
                return 0;
        }
+       /* 0 = success, 1 = not called yet */
+       if (cxt->syscall_status != 1 && cxt->syscall_status != 0) {
+               DBG(CXT, mnt_debug_h(cxt,
+                               "skip update: syscall failed [status=%d]",
+                               cxt->syscall_status));
+               return 0;
+       }
        if (!cxt->update) {
                cxt->update = mnt_new_update();
                if (!cxt->update)
@@ -1495,6 +1504,7 @@ int mnt_context_set_syscall_status(struct libmnt_context *cxt, int status)
        if (!cxt)
                return -EINVAL;
 
+       DBG(CXT, mnt_debug_h(cxt, "syscall status set to: %d", status));
        cxt->syscall_status = status;
        return 0;
 }