提交 26430752 编写于 作者: C Christoph Hellwig 提交者: Christoph Hellwig

xfs: fix error handling in xfs_log_mount

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: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NFelix Blyakher <felixb@sgi.com>
Reported-by: NLachlan McIlroy <lachlan@sgi.com>
上级 8e08f6eb
...@@ -574,7 +574,7 @@ xfs_log_mount( ...@@ -574,7 +574,7 @@ xfs_log_mount(
error = xfs_trans_ail_init(mp); error = xfs_trans_ail_init(mp);
if (error) { if (error) {
cmn_err(CE_WARN, "XFS: AIL initialisation failed: error %d", 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; mp->m_log->l_ailp = mp->m_ail;
...@@ -594,20 +594,22 @@ xfs_log_mount( ...@@ -594,20 +594,22 @@ xfs_log_mount(
mp->m_flags |= XFS_MOUNT_RDONLY; mp->m_flags |= XFS_MOUNT_RDONLY;
if (error) { if (error) {
cmn_err(CE_WARN, "XFS: log mount/recovery failed: error %d", error); cmn_err(CE_WARN, "XFS: log mount/recovery failed: error %d", error);
goto error; goto out_destroy_ail;
} }
} }
/* Normal transactions can now occur */ /* Normal transactions can now occur */
mp->m_log->l_flags &= ~XLOG_ACTIVE_RECOVERY; mp->m_log->l_flags &= ~XLOG_ACTIVE_RECOVERY;
/* End mounting message in xfs_log_mount_finish */
return 0; 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: out:
return error; return error;
} /* xfs_log_mount */ }
/* /*
* Finish the recovery of the file system. This is separate from * Finish the recovery of the file system. This is separate from
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册