From 92b7c04d0146ba7206082ffe256453aa85bc0c16 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 7 Feb 2011 15:15:30 +0100 Subject: libmount: don't prepare update if syscall failed Signed-off-by: Karel Zak --- shlibs/mount/src/context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'shlibs/mount/src') 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; } -- cgit v1.2.3-55-g7522