Add a number of assertions (BUG_ON) that have show to be valuable.
Signed-off-by: NeilBrown <neilb@suse.de>
loff_t size;
int used;
+ LAFS_BUG(test_bit(B_Index, &b->flags) &&
+ iblk(b)->uninc_table.pending_cnt > 0, b);
LAFS_BUG(!test_bit(B_IOLock, &b->flags), b);
lai = LAFSI(b->inode);
* If this block threatens problems we incorporate first.
*/
+ LAFS_BUG(!test_bit(B_Dirty, &p->b.flags) &&
+ !test_bit(B_Realloc, &p->b.flags), blk);
+
a = &p->uninc_table.pending_addr
[p->uninc_table.pending_cnt-1];
if (p->uninc_table.pending_cnt >= 1 &&
!test_bit(B_Realloc, &blk->flags) &&
phys != 0)
printk("something missing %s\n", strblk(blk));
- WARN_ON_ONCE(!test_bit(B_UnincCredit, &blk->flags) && phys &&
- !test_bit(B_Index, &blk->flags));
+ LAFS_BUG(!test_bit(B_UnincCredit, &blk->flags) && phys &&
+ !test_bit(B_Index, &blk->flags), blk);
LAFS_BUG(!test_bit(B_Dirty, &blk->flags) &&
!test_bit(B_Realloc, &blk->flags) &&
phys != 0, blk);
unmap_dblock(b, lai);
set_bit(B_Valid, &b->b.flags);
+ LAFS_BUG(!test_bit(B_Pinned, &b->b.flags), &b->b);
lafs_dirty_dblock(b);
}
a->fileaddr = addr + i;
a->physaddr = 0;
a->cnt = 1;
+ LAFS_BUG(!test_bit(B_Pinned, &ib->b.flags), &ib->b);
ib->uninc_table.pending_cnt++;
} else {
spin_unlock(&ino->i_data.private_lock);
if (!test_bit(I_Trunc, &LAFSI(ino)->iflags)) {
if (test_bit(I_Deleting, &LAFSI(ino)->iflags)) {
LAFS_BUG(ino->i_nlink, &b->b);
+ printk("Deleting inode %lu: %ld+%ld+%ld %ld+%ld\n",
+ ino->i_ino,
+ LAFSI(ino)->cblocks,
+ LAFSI(ino)->pblocks,
+ LAFSI(ino)->ablocks,
+ LAFSI(ino)->ciblocks,
+ LAFSI(ino)->piblocks);
+ BUG_ON(LAFSI(ino)->cblocks +
+ LAFSI(ino)->pblocks +
+ LAFSI(ino)->ablocks +
+ LAFSI(ino)->ciblocks +
+ LAFSI(ino)->piblocks);
lafs_erase_dblock(b);
clear_bit(I_Deleting, &LAFSI(ino)->iflags);
lafs_orphan_release(fs, b);
if (!test_bit(B_Pinned, &ib->b.flags)) {
/* must be finished */
+ LAFS_BUG(test_bit(B_Dirty, &ib->b.flags), &ib->b);
clear_bit(I_Trunc, &LAFSI(ino)->iflags);
wake_up(&fs->trunc_wait);
putiref(ib, MKREF(inode_handle_orphan));
* Pinned children.
* Incorporating it should unpin it.
*/
+ if (!list_empty(&ib2->children)) {
+ lafs_print_tree(&ib2->b, 3);
+ LAFS_BUG(1, &ib2->b);
+ }
/* lafs_iolock_written(&ib2->b); - without blocking */
if (!lafs_iolock_block_async(&ib2->b)) {
ibuf = map_iblock(new);
memcpy(ib->data, ibuf + offset, blksize - offset);
memset(ib->data + blksize - offset, 0, offset);
+ LAFS_BUG(ib->depth == 0, &ib->b);
new->depth = ib->depth + 1;
LAFSI(new->b.inode)->depth++;
((struct la_inode*)(ibuf))->depth = LAFSI(new->b.inode)->depth;
LAFS_BUG(!test_bit(B_Dirty, &ib->b.flags) &&
!test_bit(B_Realloc, &ib->b.flags), &ib->b);
- LAFS_BUG(!test_bit(B_Valid, &ib->b.flags), &ib->b);
+ LAFS_BUG(!test_bit(B_Valid, &ib->b.flags) && ib->depth > 0, &ib->b);
if (ib->depth <= 1) {
/* take a copy of the uninc_table so we can work while
}
fs->allocated_blocks += credits;
-// BUG_ON(fs->free_blocks < fs->allocated_blocks);
+ BUG_ON(fs->free_blocks < fs->allocated_blocks);
spin_unlock(&fs->alloc_lock);
return credits;
}
{
struct datablock *db = NULL;
+ BUG_ON(!list_empty(&inode->i_sb_list));
+ // Cannot test i_list as dispose_list just does list_del
if (LAFSI(inode)->dblock) {
spin_lock(&inode->i_data.private_lock);
if (LAFSI(inode)->dblock)