LAFS_BUG(test_bit(B_InoIdx, &b->flags), b);
if (test_bit(B_Index, &b->flags)) {
struct indexblock *ib = iblk(b);
- LAFS_BUG(b->physaddr == 0, b);
+
+ if (b->physaddr == 0) {
+ /* An empty index block. One doesn't
+ * see many of these as it means we trimmed
+ * out some blocks, but not all following
+ * block, and block in the hole is being
+ * looked for. Just Create a valid clear
+ * index block.
+ */
+ lafs_clear_index(ib);
+ lafs_iounlock_block(b);
+ return 0;
+ }
page = virt_to_page(ib->data);
offset = offset_in_page(ib->data);