All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rajnoha <prajnoha@fedoraproject.org>
To: lvm-devel@redhat.com
Subject: master - libdm: config: fix dm_config_write_node and variants to properly return error on failures
Date: Fri,  4 Mar 2016 14:51:23 +0000 (UTC)	[thread overview]
Message-ID: <20160304145123.80CCA60AC8@fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9720898c8ee3a4035858508b38179a143d948f4f
Commit:        9720898c8ee3a4035858508b38179a143d948f4f
Parent:        67c5006e12c9e3bf888db0fbaa78a50efcbfa9b2
Author:        Peter Rajnoha <prajnoha@redhat.com>
AuthorDate:    Fri Mar 4 15:49:00 2016 +0100
Committer:     Peter Rajnoha <prajnoha@redhat.com>
CommitterDate: Fri Mar 4 15:51:13 2016 +0100

libdm: config: fix dm_config_write_node and variants to properly return error on failures

The error was not propagated if _write_config (that is part of
dm_config_write_node and all its variants) was called recursively
for subsections.
---
 WHATS_NEW_DM         |    1 +
 libdm/libdm-config.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index d3eac29..109249a 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
 Version 1.02.119 -
 =====================================
+  Fix dm_config_write_node and variants to return error on subsection failures.
   Remove 4096 char limit due to buffer size if writing dm_config_node.
 
 Version 1.02.118 - 26th February 2016
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index 5fa06a1..dcb7c3f 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -366,7 +366,8 @@ static int _write_config(const struct dm_config_node *n, int only_one,
 			line_append(" {");
 			if (!_line_end(n, out))
 				return_0;
-			_write_config(n->child, 0, out, level + 1);
+			if (!_write_config(n->child, 0, out, level + 1))
+				return_0;
 			if (!_line_start(out))
 				return_0;
 			line_append("%s}", space);



                 reply	other threads:[~2016-03-04 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160304145123.80CCA60AC8@fedorahosted.org \
    --to=prajnoha@fedoraproject.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.