From 983d09ffe396ed5d5339a1b9ff994dd0b0f2069f Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Wed, 3 Apr 2013 16:11:15 +1100 Subject: xfs: add CRC checks to the AGI Same set of changes made to the AGF need to be made to the AGI. This patch has a similar history to the AGF, hence a similar sign-off chain. Signed-off-by: Dave Chinner Signed-off-by: Christoph Hellwig Signed-off-by: Dave Chinner Reviewed-by: Ben Myers Signed-off-by: Ben Myers --- fs/xfs/xfs_log_recover.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fs/xfs/xfs_log_recover.c') diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index da2a19e0554e..6778a7943db4 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -1971,6 +1971,14 @@ xlog_recover_do_reg_buffer( } bp->b_ops = &xfs_agfl_buf_ops; break; + case XFS_BLF_AGI_BUF: + if (*(__be32 *)bp->b_addr != cpu_to_be32(XFS_AGI_MAGIC)) { + xfs_warn(mp, "Bad AGI block magic!"); + ASSERT(0); + break; + } + bp->b_ops = &xfs_agi_buf_ops; + break; default: break; } -- cgit v1.2.3