提交 8f6c2af2 编写于 作者: D Dave Chinner 提交者: Zheng Zengkai

xfs: don't nest icloglock inside ic_callback_lock

mainline-inclusion
from mainline-v5.13-rc4
commit 6be00102
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4KIAO
CVE: NA

Reference:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6be001021f0b307c8c1544e8b3ac87de20d711de

-------------------------------------------------

It's completely unnecessary because callbacks are added to iclogs
without holding the icloglock, hence no amount of ordering between
the icloglock and ic_callback_lock will order the removal of
callbacks from the iclog.
Signed-off-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NGuo Xuenan <guoxuenan@huawei.com>
Reviewed-by: NLihong Kou <koulihong@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 6bbb9a25
......@@ -2687,11 +2687,9 @@ static void
xlog_state_do_iclog_callbacks(
struct xlog *log,
struct xlog_in_core *iclog)
__releases(&log->l_icloglock)
__acquires(&log->l_icloglock)
{
spin_unlock(&log->l_icloglock);
spin_lock(&iclog->ic_callback_lock);
while (!list_empty(&iclog->ic_callbacks)) {
LIST_HEAD(tmp);
......@@ -2702,12 +2700,6 @@ xlog_state_do_iclog_callbacks(
spin_lock(&iclog->ic_callback_lock);
}
/*
* Pick up the icloglock while still holding the callback lock so we
* serialise against anyone trying to add more callbacks to this iclog
* now we've finished processing.
*/
spin_lock(&log->l_icloglock);
spin_unlock(&iclog->ic_callback_lock);
}
......@@ -2748,13 +2740,12 @@ xlog_state_do_callback(
iclog = iclog->ic_next;
continue;
}
spin_unlock(&log->l_icloglock);
/*
* Running callbacks will drop the icloglock which means
* we'll have to run at least one more complete loop.
*/
cycled_icloglock = true;
xlog_state_do_iclog_callbacks(log, iclog);
cycled_icloglock = true;
spin_lock(&log->l_icloglock);
if (XLOG_FORCED_SHUTDOWN(log))
wake_up_all(&iclog->ic_force_wait);
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册