Skip to content

Commit

Permalink
xfs: fix error handling in xfs_log_mount
Browse files Browse the repository at this point in the history
We can't just call xfs_log_unmount_dealloc on any failure because the
ail thread which is torn down by xfs_log_unmount_dealloc might not
be initialized yet.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Felix Blyakher <felixb@sgi.com>
Reported-by: Lachlan McIlroy <lachlan@sgi.com>
  • Loading branch information
Christoph Hellwig authored and Christoph Hellwig committed Feb 12, 2009
1 parent 8e08f6e commit 2643075
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ xfs_log_mount(
error = xfs_trans_ail_init(mp);
if (error) {
cmn_err(CE_WARN, "XFS: AIL initialisation failed: error %d", error);
goto error;
goto out_free_log;
}
mp->m_log->l_ailp = mp->m_ail;

Expand All @@ -594,20 +594,22 @@ xfs_log_mount(
mp->m_flags |= XFS_MOUNT_RDONLY;
if (error) {
cmn_err(CE_WARN, "XFS: log mount/recovery failed: error %d", error);
goto error;
goto out_destroy_ail;
}
}

/* Normal transactions can now occur */
mp->m_log->l_flags &= ~XLOG_ACTIVE_RECOVERY;

/* End mounting message in xfs_log_mount_finish */
return 0;
error:
xfs_log_unmount_dealloc(mp);

out_destroy_ail:
xfs_trans_ail_destroy(mp);
out_free_log:
xlog_dealloc_log(mp->m_log);
out:
return error;
} /* xfs_log_mount */
}

/*
* Finish the recovery of the file system. This is separate from
Expand Down

0 comments on commit 2643075

Please sign in to comment.