From 38c8ee20ca728751fcba1230440a0ebab7243f1c Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 12 May 2012 13:35:58 +0200 Subject: [PATCH] * grub-core/fs/bfs.c (find_in_b_tree) [MODE_AFS]: Fix handling of exact match in inner node. --- ChangeLog | 5 +++++ grub-core/fs/bfs.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index ab1f39e0a..d303b1084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-12 Vladimir Serbinenko + + * grub-core/fs/bfs.c (find_in_b_tree) [MODE_AFS]: Fix handling of exact + match in inner node. + 2012-05-12 Vladimir Serbinenko * grub-core/fs/bfs.c (mount): Improve filesystem detection reliability. diff --git a/grub-core/fs/bfs.c b/grub-core/fs/bfs.c index 41a5557f9..6136ce3e4 100644 --- a/grub-core/fs/bfs.c +++ b/grub-core/fs/bfs.c @@ -614,7 +614,11 @@ find_in_b_tree (grub_disk_t disk, *res = grub_bfs_to_cpu64 (key_values[i | (1 << j)]); return GRUB_ERR_NONE; } +#ifdef MODE_AFS + if (cmp <= 0) +#else if (cmp < 0) +#endif i |= (1 << j); } if (i == 0) @@ -630,7 +634,11 @@ find_in_b_tree (grub_disk_t disk, *res = grub_bfs_to_cpu64 (key_values[0]); return GRUB_ERR_NONE; } +#ifdef MODE_AFS + if (cmp > 0 && level != 0) +#else if (cmp >= 0 && level != 0) +#endif { node_off = grub_bfs_to_cpu64 (key_values[0]); level--;