]> git.neil.brown.name Git - LaFS.git/commitdiff
Initialise empty index block during allocation.
authorNeilBrown <neilb@suse.de>
Thu, 3 Sep 2009 05:28:18 +0000 (15:28 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 3 Sep 2009 05:28:18 +0000 (15:28 +1000)
I'm still not sure about this handling of empty index blocks,
but leaving it invalid certainly isn't correct.  I have to
initialise it and make it valid.

index.c

diff --git a/index.c b/index.c
index 0c920cb72a9cdd68ea18e2e81545e8deeb41e5f9..28690d16c09909ae07647de7e73d298b1628ff94 100644 (file)
--- a/index.c
+++ b/index.c
@@ -1991,6 +1991,8 @@ int lafs_allocated_block(struct fs *fs, struct block *blk, u64 phys)
                        printk("Not valid in lafs_allocated_block: %s\n",
                               strblk(&p->b));
                        printk("blk is %s\n", strblk(blk));
+                       lafs_clear_index(p);
+                       set_bit(B_Valid, &p->b.flags);
                }
                LAFS_BUG(!test_bit(B_Valid, &p->b.flags), &p->b);
                if (!test_bit(B_Realloc, &p->b.flags)) {