It might be best to come up with a way to abort the scan,
but we won't want it to be running when we unmount, so wait
for it to complete and ensure it doesn't restart.
Signed-off-by: NeilBrown <neilb@suse.de>
lafs_write_state(fs);
dprintk("State written, all done %d\n", fs->seq);
- fs->scan.done = 0;
+ if (!test_bit(CleanerDisabled, &fs->fsstate))
+ fs->scan.done = 0;
fs->cleaner.cleaning = 0;
/* FIXME should I wake someone up? */
/* FIXME might I now be racing with unmount and module unload??? */
fs->checkpoint_youth = youth;
- wake_up(&fs->phase_wait);
+ lafs_wake_cleaner(fs);
}
unsigned long lafs_do_checkpoint(struct fs *fs)
fs->scan.trace = 0;
fs->total_free_prev = fs->total_free;
fs->total_free = 0;
- if (fs->scan.first_free_pass) {
- fs->scan.first_free_pass = 0;
- wake_up(&fs->phase_wait);
- }
+ fs->scan.first_free_pass = 0;
+ wake_up(&fs->phase_wait);
return MAX_SCHEDULE_TIMEOUT;
}
}
wait_event(fs->async_complete,
list_empty(&fs->pending_orphans) &&
+ fs->scan.done == 1 &&
fs->cleaner.active == 0);
lafs_checkpoint_lock(fs);
/* Don't incorporate any more segusage/quota updates. */