xfs: flush data dev on external log write
authorDave Chinner <dchinner@redhat.com>
Tue, 27 Jul 2021 23:23:46 +0000 (16:23 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 29 Jul 2021 16:27:27 +0000 (09:27 -0700)
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 <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_log.c

index 36fa2650b0813fdbec34da1dc87ba82a27c05547..96434cc4df6e5d57cf0fb24ba1870841a988ccdd 100644 (file)
@@ -833,7 +833,7 @@ xlog_write_unmount_record(
         * stamp the tail LSN into the unmount record.
         */
        if (log->l_targ != log->l_mp->m_ddev_targp)
-               blkdev_issue_flush(log->l_targ->bt_bdev);
+               blkdev_issue_flush(log->l_mp->m_ddev_targp->bt_bdev);
        return xlog_write(log, &vec, ticket, NULL, NULL, XLOG_UNMOUNT_TRANS);
 }