提交 bd9f5915 编写于 作者: B Brian Foster 提交者: Yang Yingliang

xfs: fix duplicate verification from xfs_qm_dqflush()

stable inclusion
from linux-4.19.129
commit edd948273038641da2aafa666a6666d6928777ee

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

[ Upstream commit 629dcb38 ]

The pre-flush dquot verification in xfs_qm_dqflush() duplicates the
read verifier by checking the dquot in the on-disk buffer. Instead,
verify the in-core variant before it is flushed to the buffer.

Fixes: 7224fa48 ("xfs: add full xfs_dqblk verifier")
Signed-off-by: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NAllison Collins <allison.henderson@oracle.com>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 534fc8d2
...@@ -1120,13 +1120,12 @@ xfs_qm_dqflush( ...@@ -1120,13 +1120,12 @@ xfs_qm_dqflush(
dqb = bp->b_addr + dqp->q_bufoffset; dqb = bp->b_addr + dqp->q_bufoffset;
ddqp = &dqb->dd_diskdq; ddqp = &dqb->dd_diskdq;
/* /* sanity check the in-core structure before we flush */
* A simple sanity check in case we got a corrupted dquot. fa = xfs_dquot_verify(mp, &dqp->q_core, be32_to_cpu(dqp->q_core.d_id),
*/ 0);
fa = xfs_dqblk_verify(mp, dqb, be32_to_cpu(ddqp->d_id), 0);
if (fa) { if (fa) {
xfs_alert(mp, "corrupt dquot ID 0x%x in memory at %pS", xfs_alert(mp, "corrupt dquot ID 0x%x in memory at %pS",
be32_to_cpu(ddqp->d_id), fa); be32_to_cpu(dqp->q_core.d_id), fa);
xfs_buf_relse(bp); xfs_buf_relse(bp);
xfs_dqfunlock(dqp); xfs_dqfunlock(dqp);
xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册