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

xfs: flush data dev on external log write

mainline-inclusion
from mainline-v5.14-rc1
commit b1e27239
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=b1e27239b9169f07edba0ca0e52805645a1768ba

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

We incorrectly flush the log device instead of the data device when
trying to ensure metadata is correctly on disk before writing the
unmount record.

Fixes: eef983ff ("xfs: journal IO cache flush reductions")
Signed-off-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
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>
上级 ce69b712
...@@ -806,7 +806,7 @@ xlog_write_unmount_record( ...@@ -806,7 +806,7 @@ xlog_write_unmount_record(
* stamp the tail LSN into the unmount record. * stamp the tail LSN into the unmount record.
*/ */
if (log->l_targ != log->l_mp->m_ddev_targp) if (log->l_targ != log->l_mp->m_ddev_targp)
xfs_blkdev_issue_flush(log->l_targ); xfs_blkdev_issue_flush(log->l_mp->m_ddev_targp);
return xlog_write(log, &vec, ticket, NULL, NULL, XLOG_UNMOUNT_TRANS); return xlog_write(log, &vec, ticket, NULL, NULL, XLOG_UNMOUNT_TRANS);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册