Commit c42eb0cd authored by Nathan Scott's avatar Nathan Scott

[XFS] V2 log update - tighten checks for corrupt log during recovery

SGI Modid: 2.5.x-xfs:slinx:150093a
parent 6bdfbb7b
...@@ -3454,12 +3454,16 @@ xlog_do_recovery_pass( ...@@ -3454,12 +3454,16 @@ xlog_do_recovery_pass(
goto bread_err1; goto bread_err1;
offset = xlog_align(log, tail_blk, 1, hbp); offset = xlog_align(log, tail_blk, 1, hbp);
rhead = (xlog_rec_header_t *)offset; rhead = (xlog_rec_header_t *)offset;
ASSERT(INT_GET(rhead->h_magicno, ARCH_CONVERT) == if (unlikely(
XLOG_HEADER_MAGIC_NUM); (INT_GET(rhead->h_magicno, ARCH_CONVERT) !=
if ((INT_GET(rhead->h_version, ARCH_CONVERT) & XLOG_HEADER_MAGIC_NUM) ||
(~XLOG_VERSION_OKBITS)) != 0) { (INT_ISZERO(rhead->h_version, ARCH_CONVERT)) ||
xlog_warn( (INT_GET(rhead->h_version, ARCH_CONVERT) &
"XFS: xlog_do_recovery_pass: unrecognised log version number."); (~XLOG_VERSION_OKBITS)) != 0)) {
xlog_warn("XFS: %s: bad log magic/version (0x%x/%d)",
__FUNCTION__,
INT_GET(rhead->h_magicno, ARCH_CONVERT),
INT_GET(rhead->h_version, ARCH_CONVERT));
error = XFS_ERROR(EIO); error = XFS_ERROR(EIO);
goto bread_err1; goto bread_err1;
} }
......
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