summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_sb.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-11-09 12:11:12 +1100
committerDave Chinner <david@fromorbit.com>2016-11-09 12:11:12 +1100
commitbec9d48d7a303a5bb95c05961ff07ec7eeb59058 (patch)
tree2a8f57e3c11bdd9e40cb360347efb30854f93a12 /fs/xfs/libxfs/xfs_sb.c
parent4fd29ec47212c8cbf98916af519019ccc5e58e49 (diff)
downloadop-kernel-dev-bec9d48d7a303a5bb95c05961ff07ec7eeb59058.zip
op-kernel-dev-bec9d48d7a303a5bb95c05961ff07ec7eeb59058.tar.gz
xfs: check minimum block size for CRC filesystems
Check the minimum block size on v5 filesystems. [dchinner: cleaned up XFS_MIN_CRC_BLOCKSIZE check] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_sb.c')
-rw-r--r--fs/xfs/libxfs/xfs_sb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index 7a39240..2580262 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -262,6 +262,12 @@ xfs_mount_validate_sb(
return -EFSCORRUPTED;
}
+ if (xfs_sb_version_hascrc(&mp->m_sb) &&
+ sbp->sb_blocksize < XFS_MIN_CRC_BLOCKSIZE) {
+ xfs_notice(mp, "v5 SB sanity check failed");
+ return -EFSCORRUPTED;
+ }
+
/*
* Until this is fixed only page-sized or smaller data blocks work.
*/
OpenPOWER on IntegriCloud