summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2014-06-24 09:25:18 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-09-11 15:53:27 +0200
commit6dbc4e658cb9f4a980022a0e152c5ec4c023e8d9 (patch)
treec558c988a40ff7b64acf77b94b10537331398723
parent6503dd7370427100d1b9537b90c2d934e0c965d8 (diff)
downloadbarebox-6dbc4e658cb9f4a980022a0e152c5ec4c023e8d9.tar.gz
barebox-6dbc4e658cb9f4a980022a0e152c5ec4c023e8d9.tar.xz
UBI: fix the volumes tree sorting criteria
Commig "604b592 UBI: fix rb_tree node comparison in add_map" broke fastmap backward compatibility and older fastmap images cannot be mounted anymore. The reason is that it changes the volumes RB-tree sorting criteria. This patch fixes the problem. Artem: re-write the commit message Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r--drivers/mtd/ubi/fastmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 3aa7aa8173..21b7f076b1 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -125,7 +125,7 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id,
parent = *p;
av = rb_entry(parent, struct ubi_ainf_volume, rb);
- if (vol_id < av->vol_id)
+ if (vol_id > av->vol_id)
p = &(*p)->rb_left;
else
p = &(*p)->rb_right;