]> git.neil.brown.name Git - LaFS.git/commitdiff
Fix block number selection in roll-forward
authorNeilBrown <neilb@suse.de>
Fri, 4 Mar 2011 23:44:23 +0000 (10:44 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 4 Mar 2011 23:44:23 +0000 (10:44 +1100)
When I changed this to use lafs_seg_next I broke it, and didn't
test properly.
So enhance the testing to catch this.

Signed-off-by: NeilBrown <neilb@suse.de>
roll.c
test/go

diff --git a/roll.c b/roll.c
index 3e3a6e3271256e239f0ae759d921d207adaf8ae4..664884bb22da131ed538f9cb618450484960870c 100644 (file)
--- a/roll.c
+++ b/roll.c
@@ -618,6 +618,8 @@ roll_one(struct fs *fs, u64 *addrp, struct page *p, struct page *pg,
                                                      * response */
                                /* FIXME range check count */
                                while (!err && cnt--) {
+                                       if (bytes != DescHole)
+                                               baddr = lafs_seg_next(fs, &seg);
                                        if (bytes != DescHole &&
                                            !baddr) {
                                                /* We have fallen off the end of
@@ -635,8 +637,6 @@ roll_one(struct fs *fs, u64 *addrp, struct page *p, struct page *pg,
                                                                 : blocksize,
                                                                 pg);
                                        bnum++;
-                                       if (bytes != DescHole)
-                                               baddr = lafs_seg_next(fs, &seg);
                                }
                                desc++;
                        } else {
diff --git a/test/go b/test/go
index 3e970928f03ecd1d430405134de3a3bd60ada332..033dacd1041b13db224629f7ac3ef70e82f9ebce 100644 (file)
--- a/test/go
+++ b/test/go
@@ -22,7 +22,12 @@ ls /mnt/1;
 ls -ia /mnt/1
 #mount /dev/sdb /mnt/2
 #cat /mnt/1/17
-md5sum /mnt/1/afile
+a=`md5sum /mnt/1/afile`
+echo $a
+set $a
+if [ $1 != 'db53a848287fe6dc69da95678da94f6a' ]
+then echo "Bad match" ; exit 1
+fi
 echo 'db53....4f6a'
 (  > /mnt/1/fred )
 ls -li /mnt/1