]> git.neil.brown.name Git - LaFS.git/commitdiff
Fix bug in sort_block
authorNeilBrown <neilb@suse.de>
Fri, 24 Sep 2010 01:43:42 +0000 (11:43 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 24 Sep 2010 01:43:42 +0000 (11:43 +1000)
It doesn't handle 2 blocks the same - which isn't a big deal, but it
is best to have the code 'right'

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

index 424febaba374e875177b0c9d64d12a90a3bd5e61..4b74a650de24de6b7d196dde066f1ef5ed0f614c 100644 (file)
--- a/modify.c
+++ b/modify.c
@@ -80,8 +80,8 @@ static void sort_blocks(struct block **blkp)
                        if (b[next] == NULL ||
                            (b[1-next] != NULL &&
                             !((prev <= b[1-next]->fileaddr)
-                              ^(b[1-next]->fileaddr <= b[next]->fileaddr)
-                              ^(b[next]->fileaddr <= prev)))
+                              ^(prev <= b[next]->fileaddr)
+                              ^(b[next]->fileaddr <= b[1-next]->fileaddr)))
                                )
                                next = 1 - next;