When truncate finishes and we are about to delete the inode,
we need to have the index block clean and unpinned so it can disappear
cleanly.
lafs_cluster_allocate nicely does this for us.
Signed-off-by: NeilBrown <neilb@suse.de>
if (LAFSI(ino)->depth == 0) {
/* Nothing to truncate */
clear_bit(I_Trunc, &LAFSI(ino)->iflags);
- lafs_iounlock_block(&ib->b);
+ if (test_bit(B_Pinned, &ib->b.flags))
+ /* Need to move the dirtiness which keeps this
+ * pinned to the data block.
+ */
+ lafs_cluster_allocate(&ib->b, 0);
+ else
+ lafs_iounlock_block(&ib->b);
putiref(ib, MKREF(inode_handle_orphan3));
goto restart;
}