From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:36898 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387964AbfETQO4 (ORCPT ); Mon, 20 May 2019 12:14:56 -0400 Received: from 089144206147.atnat0015.highway.bob.at ([89.144.206.147] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSkwB-0005dQ-PU for linux-xfs@vger.kernel.org; Mon, 20 May 2019 16:14:56 +0000 From: Christoph Hellwig Subject: [PATCH 05/17] xfs: don't use REQ_PREFLUSH for split log writes Date: Mon, 20 May 2019 18:13:35 +0200 Message-Id: <20190520161347.3044-6-hch@lst.de> In-Reply-To: <20190520161347.3044-1-hch@lst.de> References: <20190520161347.3044-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: linux-xfs@vger.kernel.org If we have to split a log write because it wraps the end of the log we can't just use REQ_PREFLUSH to flush before the first log write, as the writes might get reordered somewhere in the I/O stack. Issue a manual flush in that case so that the ordering of the two log I/Os doesn't matter. Signed-off-by: Christoph Hellwig --- 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 e7c9e1a653a8..1374f5d6c372 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1912,7 +1912,7 @@ xlog_sync( * synchronously here; for an internal log we can simply use the block * layer state machine for preflushes. */ - if (log->l_mp->m_logdev_targp != log->l_mp->m_ddev_targp) + if (log->l_mp->m_logdev_targp != log->l_mp->m_ddev_targp || split) xfs_blkdev_issue_flush(log->l_mp->m_ddev_targp); else bp->b_flags |= XBF_FLUSH; -- 2.20.1