If, during truncate, we find an index block in writeback,
we need to give up on the orphan and return back up
to the cleaner thread so that the writeback can be
properly handled.
Otherwise the cleaner thread is blocked waiting for the cleaner thread
to make progress.
Signed-off-by: NeilBrown <neilb@suse.de>
struct inode *ino = b->my_inode;
struct fs *fs = fs_from_inode(ino);
u32 trunc_next, next_trunc;
+ int do_restart;
restart:
+ do_restart = 1;
if (!test_bit(I_Trunc, &LAFSI(ino)->iflags)) {
if (test_bit(I_Deleting, &LAFSI(ino)->iflags)) {
if (test_bit(B_Writeback, &ib2->b.flags)) {
lafs_iounlock_block(&ib2->b);
putiref(ib2, MKREF(inode_handle_orphan2));
+ do_restart = 0;
goto out2;
}
do
}
out2:
putiref(ib, MKREF(inode_handle_orphan));
- goto restart;
+ if (do_restart)
+ goto restart;
+ else
+ return;
}
putiref(ib, MKREF(inode_handle_orphan));