Skip to content

Commit e911036

Browse files
hsdenxdedekind
authored andcommitted
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>
1 parent a497c3b commit e911036

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/mtd/ubi/fastmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id,
125125
parent = *p;
126126
av = rb_entry(parent, struct ubi_ainf_volume, rb);
127127

128-
if (vol_id < av->vol_id)
128+
if (vol_id > av->vol_id)
129129
p = &(*p)->rb_left;
130130
else
131131
p = &(*p)->rb_right;

0 commit comments

Comments
 (0)