From d3a6df1276a5e29b83b781bdc900dcfca11f959e Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 27 Dec 2021 19:42:58 +0800 Subject: [PATCH] xfs: flush data dev on external log write mainline-inclusion from mainline-v5.14-rc1 commit b1e27239b9169f07edba0ca0e52805645a1768ba 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: eef983ffeae7 ("xfs: journal IO cache flush reductions") Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Signed-off-by: Guo Xuenan Reviewed-by: Lihong Kou Reviewed-by: Zhang Yi Signed-off-by: Zheng Zengkai --- fs/xfs/xfs_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 8479df31cb43..fed7a6c3d23e 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -806,7 +806,7 @@ xlog_write_unmount_record( * stamp the tail LSN into the unmount record. */ 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); } -- GitLab