diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_mount.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index f6bfbd734669..e8e310c05097 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -314,7 +314,8 @@ STATIC int | |||
314 | xfs_mount_validate_sb( | 314 | xfs_mount_validate_sb( |
315 | xfs_mount_t *mp, | 315 | xfs_mount_t *mp, |
316 | xfs_sb_t *sbp, | 316 | xfs_sb_t *sbp, |
317 | bool check_inprogress) | 317 | bool check_inprogress, |
318 | bool check_version) | ||
318 | { | 319 | { |
319 | 320 | ||
320 | /* | 321 | /* |
@@ -337,9 +338,10 @@ xfs_mount_validate_sb( | |||
337 | 338 | ||
338 | /* | 339 | /* |
339 | * Version 5 superblock feature mask validation. Reject combinations the | 340 | * Version 5 superblock feature mask validation. Reject combinations the |
340 | * kernel cannot support up front before checking anything else. | 341 | * kernel cannot support up front before checking anything else. For |
342 | * write validation, we don't need to check feature masks. | ||
341 | */ | 343 | */ |
342 | if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) { | 344 | if (check_version && XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) { |
343 | xfs_alert(mp, | 345 | xfs_alert(mp, |
344 | "Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!\n" | 346 | "Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!\n" |
345 | "Use of these features in this kernel is at your own risk!"); | 347 | "Use of these features in this kernel is at your own risk!"); |
@@ -675,7 +677,8 @@ xfs_sb_to_disk( | |||
675 | 677 | ||
676 | static int | 678 | static int |
677 | xfs_sb_verify( | 679 | xfs_sb_verify( |
678 | struct xfs_buf *bp) | 680 | struct xfs_buf *bp, |
681 | bool check_version) | ||
679 | { | 682 | { |
680 | struct xfs_mount *mp = bp->b_target->bt_mount; | 683 | struct xfs_mount *mp = bp->b_target->bt_mount; |
681 | struct xfs_sb sb; | 684 | struct xfs_sb sb; |
@@ -686,7 +689,8 @@ xfs_sb_verify( | |||
686 | * Only check the in progress field for the primary superblock as | 689 | * Only check the in progress field for the primary superblock as |
687 | * mkfs.xfs doesn't clear it from secondary superblocks. | 690 | * mkfs.xfs doesn't clear it from secondary superblocks. |
688 | */ | 691 | */ |
689 | return xfs_mount_validate_sb(mp, &sb, bp->b_bn == XFS_SB_DADDR); | 692 | return xfs_mount_validate_sb(mp, &sb, bp->b_bn == XFS_SB_DADDR, |
693 | check_version); | ||
690 | } | 694 | } |
691 | 695 | ||
692 | /* | 696 | /* |
@@ -719,7 +723,7 @@ xfs_sb_read_verify( | |||
719 | goto out_error; | 723 | goto out_error; |
720 | } | 724 | } |
721 | } | 725 | } |
722 | error = xfs_sb_verify(bp); | 726 | error = xfs_sb_verify(bp, true); |
723 | 727 | ||
724 | out_error: | 728 | out_error: |
725 | if (error) { | 729 | if (error) { |
@@ -758,7 +762,7 @@ xfs_sb_write_verify( | |||
758 | struct xfs_buf_log_item *bip = bp->b_fspriv; | 762 | struct xfs_buf_log_item *bip = bp->b_fspriv; |
759 | int error; | 763 | int error; |
760 | 764 | ||
761 | error = xfs_sb_verify(bp); | 765 | error = xfs_sb_verify(bp, false); |
762 | if (error) { | 766 | if (error) { |
763 | XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, bp->b_addr); | 767 | XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, bp->b_addr); |
764 | xfs_buf_ioerror(bp, error); | 768 | xfs_buf_ioerror(bp, error); |