summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/context.c
diff options
context:
space:
mode:
authorKarel Zak2011-02-07 15:15:30 +0100
committerKarel Zak2011-02-07 15:15:30 +0100
commit92b7c04d0146ba7206082ffe256453aa85bc0c16 (patch)
tree63e78f2f2708cbe8a8301eea64ce88c96f6a03a0 /shlibs/mount/src/context.c
parentdocs: update ReleaseNotes (diff)
downloadkernel-qcow2-util-linux-92b7c04d0146ba7206082ffe256453aa85bc0c16.tar.gz
kernel-qcow2-util-linux-92b7c04d0146ba7206082ffe256453aa85bc0c16.tar.xz
kernel-qcow2-util-linux-92b7c04d0146ba7206082ffe256453aa85bc0c16.zip
libmount: don't prepare update if syscall failed
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/context.c')
-rw-r--r--shlibs/mount/src/context.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/shlibs/mount/src/context.c b/shlibs/mount/src/context.c
index 23cb4b994..a481d9cb8 100644
--- a/shlibs/mount/src/context.c
+++ b/shlibs/mount/src/context.c
@@ -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;
}