Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9110361 authored by Heiko Schocher's avatar Heiko Schocher Committed by Artem Bityutskiy
Browse files

UBI: fix the volumes tree sorting criteria



Commig "604b592e 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: default avatarHeiko Schocher <hs@denx.de>
Acked-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent a497c3ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -125,7 +125,7 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id,
		parent = *p;
		parent = *p;
		av = rb_entry(parent, struct ubi_ainf_volume, rb);
		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;
			p = &(*p)->rb_left;
		else
		else
			p = &(*p)->rb_right;
			p = &(*p)->rb_right;