This can happen when adding blocks to a prevously truncated
file, or even when continuing with a slow truncate.
phys==0 just means the index block is empty, so honour that.
if (test_bit(B_Index, &b->flags)) {
struct indexblock *ib = iblk(b);
if (b->physaddr == 0) {
- LAFS_BUG(1, b);
- /* I think this is really an error FIXME */
- memset(ib->data, 0, b->inode->i_sb->s_blocksize);
+ lafs_clear_index(ib);
+ set_bit(B_Valid, &ib->b.flags);
lafs_iounlock_block(b);
- return -EIO;
+ return 0;
}
page = virt_to_page(ib->data);
offset = offset_in_page(ib->data);