The unmount thread should run any orphans. That should be
left to the cleaner thread.
It might be useful to wait for the cleaner to finish up.
An alternate might be to release all pending-for-clean blocks.
Signed-off-by: NeilBrown <neilb@suse.de>
}
if (doflush)
cleaner_flush(fs);
- if (cnt == 0)
+ if (cnt == 0) {
fs->cleaner.active = 0;
+ wake_up(&fs->async_complete);
+ }
}
return MAX_SCHEDULE_TIMEOUT;
}
list_splice(&done, &fs->pending_orphans);
spin_unlock(&fs->lock);
- if (list_empty(&fs->pending_orphans))
+ if (list_empty_careful(&fs->pending_orphans))
/* unmount might be waiting... */
wake_up(&fs->async_complete);
return MAX_SCHEDULE_TIMEOUT;
/* This is the main sb, not a snapshot or
* subordinate fs
*/
+ /* FIXME I'm not sure we should be waiting for the
+ * cleaner. Maybe we should just release all tc->cleaning
+ * blocks instead.
+ */
wait_event(fs->async_complete,
- (lafs_run_orphans(fs), list_empty(&fs->pending_orphans)));
+ list_empty(&fs->pending_orphans) &&
+ fs->cleaner.active == 0);
lafs_checkpoint_lock(fs);
/* Don't incorporate any more segusage/quota updates. */
lafs_checkpoint_start(fs);