From 8cbf6df5aa356a92d4ab6c515bb6bd308bff250d Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 8 Jun 2010 18:10:37 +1000 Subject: [PATCH] truncate: fixes for pruning addresses. 1/ after pruning addresses, we need to clear the index block 2/ InoIdx blocks don't follow the rule that physaddr==0 means empty. Signed-off-by: NeilBrown --- inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inode.c b/inode.c index 44fb73f..e1ce2f2 100644 --- a/inode.c +++ b/inode.c @@ -797,10 +797,12 @@ void lafs_inode_handle_orphan(struct datablock *b) LAFS_BUG(!test_bit(B_Dirty, &ib->b.flags), &ib->b); lafs_incorporate(fs, ib); } - if (!test_bit(B_PhysValid, &ib->b.flags) || + if (test_bit(B_InoIdx, &ib->b.flags) || + !test_bit(B_PhysValid, &ib->b.flags) || ib->b.physaddr != 0) { lafs_dirty_iblock(ib); lafs_walk_leaf_index(ib, prune, ib); + lafs_clear_index(ib); } if (test_bit(B_Dirty, &ib->b.flags)) lafs_incorporate(fs, ib); -- 2.39.5