int ss;
struct lafs_inode *li;
- lafs_checkpoint_lock(fs);
- lafs_checkpoint_start(fs);
- if (sb == fs->prime_sb)
- /* Don't incorporate any more segusage/quota updates. */
- set_bit(FinalCheckpoint, &fs->fsstate);
- lafs_checkpoint_unlock_wait(fs);
- lafs_cluster_wait_all(fs);
+ /* If !fs->thread, we never really mounted the fs, so this
+ * cleanup is inappropriate .. and cannot work anyway.
+ */
+ if (fs->thread) {
+ lafs_checkpoint_lock(fs);
+ lafs_checkpoint_start(fs);
+ if (sb == fs->prime_sb)
+ /* Don't incorporate any more segusage/quota updates. */
+ set_bit(FinalCheckpoint, &fs->fsstate);
+ lafs_checkpoint_unlock_wait(fs);
+ lafs_cluster_wait_all(fs);
+ }
if (sb == fs->prime_sb) {
int d;
err = lafs_mount(fs);
if (err == 0)
err = lafs_start_thread(fs);
- if (err)
+ if (err) {
+ /* Don't wait for any scan to finish ... */
+ fs->scan.done = 1;
+ fs->checkpointing = 0;
deactivate_locked_super(fs->prime_sb);
- else {
+ } else {
fs->prime_sb->s_flags |= MS_ACTIVE;
simple_set_mnt(mnt, fs->prime_sb);
}
static int lafs_sync_fs(struct super_block *sb, int wait)
{
+ if (fs_from_sb(sb)->thread == NULL)
+ /* Filesystem in not active - nothing to sync */
+ return 0;
if (!wait)
/* We only reach here if s_dirt was set, so it
* is reasonable to force a checkpoint.