public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Alexander Schmidt <alexs@linux.vnet.ibm.com>
To: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Cc: Andreas Arnez <arnez@linux.vnet.ibm.com>,
	Frank Haverkamp <haver@linux.vnet.ibm.com>
Subject: [PATCH] UBI-Utils: ubimirror discards returncode
Date: Fri, 29 Jun 2007 12:46:11 +0200	[thread overview]
Message-ID: <200706291246.11487.alexs@linux.vnet.ibm.com> (raw)

Ubimirror compares volumes before they are mirrored, but discards the
result of the comparison and alway copies volumes.

I've tested this code with equal and unequal volumes and it seems to work
fine now.

Signed-off-by: Alexander Schmidt <alexs@linux.vnet.ibm.com>
---
 ubi-utils/src/libubimirror.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

--- mtd-utils.orig/ubi-utils/src/libubimirror.c
+++ mtd-utils/ubi-utils/src/libubimirror.c
@@ -190,11 +190,13 @@ int ubimirror(uint32_t devno, int seqnum
 		if (rc < 0) {
 			EBUF("compare error volume %d and %d", src_id, ids[i]);
 			goto err;
-		}
-		rc = copy_files(fd_in, fd_out);
-		if (rc != 0) {
-			EBUF("mirror error volume %d to %d", src_id, ids[i]);
-			goto err;
+		} else if (rc == compare_different) {
+			rc = copy_files(fd_in, fd_out);
+			if (rc != 0) {
+				EBUF("mirror error volume %d to %d", src_id,
+						ids[i]);
+				goto err;
+			}
 		}
 		if ((rc = ubi_vol_close(fd_out)) == -1) {
 			EBUF("close error volume %d", ids[i]);

             reply	other threads:[~2007-06-29 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 10:46 Alexander Schmidt [this message]
2007-06-29 11:54 ` [PATCH] UBI-Utils: ubimirror discards returncode Artem Bityutskiy

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=200706291246.11487.alexs@linux.vnet.ibm.com \
    --to=alexs@linux.vnet.ibm.com \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=haver@linux.vnet.ibm.com \
    --cc=linux-mtd@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox