]> git.neil.brown.name Git - LaFS.git/commitdiff
fix leaf_lookup for indirect blocks.
authorNeilBrown <neilb@suse.de>
Wed, 23 Jun 2010 01:44:34 +0000 (11:44 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 23 Jun 2010 02:48:51 +0000 (12:48 +1000)
If the space was an exact multiple of 6 bytes, we would not consider
the final entry as a possible 'next'.

Signed-off-by: NeilBrown <neilb@suse.de>
index.c

diff --git a/index.c b/index.c
index 7bb1a9cdb3678056ed8ae31d15e0647ec417c49b..13e5bc9e8ee1f5b0e8812e9b3919c1a34dc65a86 100644 (file)
--- a/index.c
+++ b/index.c
@@ -1177,7 +1177,7 @@ leaf_lookup(void *bf, int len, u32 startaddr, u32 target, u32 *nextp)
                        len -= 6;
                        next++;
                        *nextp = ~0UL;
-                       while (len > 6) {
+                       while (len >= 6) {
                                p2 = decode48(buf);
                                if (p2) {
                                        *nextp = next;