Commit 9c235dfc authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Chandan Babu R

xfs: dquot recovery does not validate the recovered dquot

When we're recovering ondisk quota records from the log, we need to
validate the recovered buffer contents before writing them to disk.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
parent ed17f7da
......@@ -19,6 +19,7 @@
#include "xfs_log.h"
#include "xfs_log_priv.h"
#include "xfs_log_recover.h"
#include "xfs_error.h"
STATIC void
xlog_recover_dquot_ra_pass2(
......@@ -152,6 +153,19 @@ xlog_recover_dquot_commit_pass2(
XFS_DQUOT_CRC_OFF);
}
/* Validate the recovered dquot. */
fa = xfs_dqblk_verify(log->l_mp, dqb, dq_f->qlf_id);
if (fa) {
XFS_CORRUPTION_ERROR("Bad dquot after recovery",
XFS_ERRLEVEL_LOW, mp, dqb,
sizeof(struct xfs_dqblk));
xfs_alert(mp,
"Metadata corruption detected at %pS, dquot 0x%x",
fa, dq_f->qlf_id);
error = -EFSCORRUPTED;
goto out_release;
}
ASSERT(dq_f->qlf_size == 2);
ASSERT(bp->b_mount == mp);
bp->b_flags |= _XBF_LOGRECOVERY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment