diff options
author | Heiko Schocher <hs@denx.de> | 2014-06-24 03:25:18 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-07-01 02:23:03 -0400 |
commit | e9110361a9a4e258b072b14bd44eb78cf11453cb (patch) | |
tree | 7b1048a62c3a6c981af59df7b7569bef9fbd28c2 /drivers/mtd/ubi | |
parent | a497c3ba1d97fc69c1e78e7b96435ba8c2cb42ee (diff) |
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>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r-- | drivers/mtd/ubi/fastmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index b04e7d059888..72f39daee649 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, | |||
125 | parent = *p; | 125 | parent = *p; |
126 | av = rb_entry(parent, struct ubi_ainf_volume, rb); | 126 | av = rb_entry(parent, struct ubi_ainf_volume, rb); |
127 | 127 | ||
128 | if (vol_id < av->vol_id) | 128 | if (vol_id > av->vol_id) |
129 | p = &(*p)->rb_left; | 129 | p = &(*p)->rb_left; |
130 | else | 130 | else |
131 | p = &(*p)->rb_right; | 131 | p = &(*p)->rb_right; |