提交 a582f32f 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: simplify log shutdown checking in xfs_log_release_iclog

There is no need to check for the ioerror state before the lock, as
the shutdown case is not a fast path.  Also remove the call to force
shutdown the file system, as it must have been shut down already
for an iclog to be in the ioerror state.  Also clean up the flow of
the function a bit.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 f97a43e4
无相关合并请求
...@@ -602,24 +602,16 @@ xfs_log_release_iclog( ...@@ -602,24 +602,16 @@ xfs_log_release_iclog(
struct xlog_in_core *iclog) struct xlog_in_core *iclog)
{ {
struct xlog *log = iclog->ic_log; struct xlog *log = iclog->ic_log;
bool sync; bool sync = false;
if (iclog->ic_state == XLOG_STATE_IOERROR)
goto error;
if (atomic_dec_and_lock(&iclog->ic_refcnt, &log->l_icloglock)) { if (atomic_dec_and_lock(&iclog->ic_refcnt, &log->l_icloglock)) {
if (iclog->ic_state == XLOG_STATE_IOERROR) { if (iclog->ic_state != XLOG_STATE_IOERROR)
spin_unlock(&log->l_icloglock); sync = __xlog_state_release_iclog(log, iclog);
goto error;
}
sync = __xlog_state_release_iclog(log, iclog);
spin_unlock(&log->l_icloglock); spin_unlock(&log->l_icloglock);
if (sync)
xlog_sync(log, iclog);
} }
return;
error: if (sync)
xfs_force_shutdown(log->l_mp, SHUTDOWN_LOG_IO_ERROR); xlog_sync(log, iclog);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册