aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_fsops.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-11-12 06:54:03 -0500
committerBen Myers <bpm@sgi.com>2012-11-15 22:34:07 -0500
commit98021821a502db347bd9c7671beeee6e8ce07ea6 (patch)
tree1cfb76746a51e6713ff4ba2842ed55c90c4b063b /fs/xfs/xfs_fsops.c
parenteab4e63368b4cfa597dbdac66d1a7a836a693b7d (diff)
xfs: verify superblocks as they are read from disk
Add a superblock verify callback function and pass it into the buffer read functions. Remove the now redundant verification code that is currently in use. Adding verification shows that secondary superblocks never have their "sb_inprogress" flag cleared by mkfs.xfs, so when validating the secondary superblocks during a grow operation we have to avoid checking this field. Even if we fix mkfs, we will still have to ignore this field for verification purposes unless a version of mkfs that does not have this bug was used. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Phil White <pwhite@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_fsops.c')
-rw-r--r--fs/xfs/xfs_fsops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index f35f8d7731f0..cb65b067ed31 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -444,7 +444,8 @@ xfs_growfs_data_private(
444 if (agno < oagcount) { 444 if (agno < oagcount) {
445 error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp, 445 error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp,
446 XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)), 446 XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)),
447 XFS_FSS_TO_BB(mp, 1), 0, &bp, NULL); 447 XFS_FSS_TO_BB(mp, 1), 0, &bp,
448 xfs_sb_read_verify);
448 } else { 449 } else {
449 bp = xfs_trans_get_buf(NULL, mp->m_ddev_targp, 450 bp = xfs_trans_get_buf(NULL, mp->m_ddev_targp,
450 XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)), 451 XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)),
@@ -462,6 +463,7 @@ xfs_growfs_data_private(
462 break; 463 break;
463 } 464 }
464 xfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb, XFS_SB_ALL_BITS); 465 xfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb, XFS_SB_ALL_BITS);
466
465 /* 467 /*
466 * If we get an error writing out the alternate superblocks, 468 * If we get an error writing out the alternate superblocks,
467 * just issue a warning and continue. The real work is 469 * just issue a warning and continue. The real work is