* [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
* Re: [PATCH] UBI-Utils: ubimirror discards returncode
2007-06-29 10:46 [PATCH] UBI-Utils: ubimirror discards returncode Alexander Schmidt
@ 2007-06-29 11:54 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2007-06-29 11:54 UTC (permalink / raw)
To: Alexander Schmidt
Cc: linux-mtd@lists.infradead.org, Andreas Arnez, Frank Haverkamp
On Fri, 29 Jun 2007, Alexander Schmidt wrote:
> 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>
Thanks.
^ 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox