]> git.neil.brown.name Git - LaFS.git/commitdiff
grow_index_tree: handle B_Root correctly
authorNeilBrown <neilb@suse.de>
Thu, 10 Jun 2010 06:02:14 +0000 (16:02 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 13 Jun 2010 07:20:00 +0000 (17:20 +1000)
When a grow the index tree for the root inode, the B_Root
bit needs to be moved to the new block.

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

index 4f70400508f6fc6888c4fc3ec4c7c94bbf97a17d..ac67430c3a1d7406376d41228c7cba9f2ecb5441 100644 (file)
--- a/modify.c
+++ b/modify.c
@@ -454,8 +454,10 @@ static void grow_index_tree(struct indexblock *ib, struct indexblock *new)
        ib->data = new->data;  new->data = NULL;
        clear_bit(B_InoIdx, &ib->b.flags);
        lafs_hash_iblock(ib);
-
        set_bit(B_InoIdx, &new->b.flags);
+       if (test_and_clear_bit(B_Root, &ib->b.flags))
+               set_bit(B_Root, &new->b.flags);
+
        new->b.fileaddr = 0;
        new->b.inode = ib->b.inode;
        new->b.parent = ib->b.parent;