projects/linux·commit e9110361

UBI: fix the volumes tree sorting criteria

e9110361 · Heiko Schocher <[email protected]> · 2014-06-24 09:25:18 +02:00

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 <[email protected]>
Acked-by: Richard Weinberger <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Commit
e9110361a9a4e258b072b14bd44eb78cf11453cb
Parents
a497c3ba

Changes

1 files changed · +1 −1

FileStatusAddDelContent
drivers/mtd/ubi/fastmap.cmodified+1−1View file

drivers/mtd/ubi/fastmap.c

View file
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index b04e7d0..72f39da 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;