summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_recover.c
diff options
context:
space:
mode:
authorDave Chinner2013-04-03 07:11:31 +0200
committerBen Myers2013-04-27 20:03:12 +0200
commit04a1e6c5b222b089c6960dfc5352002002a4355f (patch)
tree8d6fd5760be10aad7e11e50a8fd12a678a288908 /fs/xfs/xfs_log_recover.c
parentxfs: buffer type overruns blf_flags field (diff)
downloadkernel-qcow2-linux-04a1e6c5b222b089c6960dfc5352002002a4355f.tar.gz
kernel-qcow2-linux-04a1e6c5b222b089c6960dfc5352002002a4355f.tar.xz
kernel-qcow2-linux-04a1e6c5b222b089c6960dfc5352002002a4355f.zip
xfs: add CRC checks to the superblock
With the addition of CRCs, there is such a wide and varied change to the on disk format that it makes sense to bump the superblock version number rather than try to use feature bits for all the new functionality. This commit introduces all the new superblock fields needed for all the new functionality: feature masks similar to ext4, separate project quota inodes, a LSN field for recovery and the CRC field. This commit does not bump the superblock version number, however. That will be done as a separate commit at the end of the series after all the new functionality is present so we switch it all on in one commit. This means that we can slowly introduce the changes without them being active and hence maintain bisectability of the tree. This patch is based on a patch originally written by myself back from SGI days, which was subsequently modified by Christoph Hellwig. There is relatively little of that patch remaining, but the history of the patch still should be acknowledged here. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Ben Myers <bpm@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r--fs/xfs/xfs_log_recover.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 86285071700b..5303b3db3c98 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2040,6 +2040,14 @@ xlog_recovery_validate_buf_type(
}
bp->b_ops = &xfs_attr3_rmt_buf_ops;
break;
+ case XFS_BLFT_SB_BUF:
+ if (magic32 != XFS_SB_MAGIC) {
+ xfs_warn(mp, "Bad SB block magic!");
+ ASSERT(0);
+ break;
+ }
+ bp->b_ops = &xfs_sb_buf_ops;
+ break;
default:
xfs_warn(mp, "Unknown buffer type %d!",
xfs_blft_from_flags(buf_f));