All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] UBI-Utils: ubimirror discards returncode
@ 2007-06-29 10:46 Alexander Schmidt
  2007-06-29 11:54 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Schmidt @ 2007-06-29 10:46 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org; +Cc: Andreas Arnez, Frank Haverkamp

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]);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-29 11:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-29 10:46 [PATCH] UBI-Utils: ubimirror discards returncode Alexander Schmidt
2007-06-29 11:54 ` Artem Bityutskiy

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.