Commit 34510185 authored by Dave Chinner's avatar Dave Chinner Committed by Ben Myers

xfs: don't emit v5 superblock warnings on write

We write the superblock every 30s or so which results in the
verifier being called. Right now that results in this output
every 30s:

XFS (vda): Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!
Use of these features in this kernel is at your own risk!

And spamming the logs.

We don't need to check for whether we support v5 superblocks or
whether there are feature bits we don't support set as these are
only relevant when we first mount the filesytem. i.e. on superblock
read. Hence for the write verification we can just skip all the
checks (and hence verbose output) altogether.
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent ad1858d7
...@@ -314,7 +314,8 @@ STATIC int ...@@ -314,7 +314,8 @@ STATIC int
xfs_mount_validate_sb( xfs_mount_validate_sb(
xfs_mount_t *mp, xfs_mount_t *mp,
xfs_sb_t *sbp, xfs_sb_t *sbp,
bool check_inprogress) bool check_inprogress,
bool check_version)
{ {
/* /*
...@@ -337,9 +338,10 @@ xfs_mount_validate_sb( ...@@ -337,9 +338,10 @@ xfs_mount_validate_sb(
/* /*
* Version 5 superblock feature mask validation. Reject combinations the * Version 5 superblock feature mask validation. Reject combinations the
* kernel cannot support up front before checking anything else. * kernel cannot support up front before checking anything else. For
* write validation, we don't need to check feature masks.
*/ */
if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) { if (check_version && XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) {
xfs_alert(mp, xfs_alert(mp,
"Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!\n" "Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!\n"
"Use of these features in this kernel is at your own risk!"); "Use of these features in this kernel is at your own risk!");
...@@ -675,7 +677,8 @@ xfs_sb_to_disk( ...@@ -675,7 +677,8 @@ xfs_sb_to_disk(
static int static int
xfs_sb_verify( xfs_sb_verify(
struct xfs_buf *bp) struct xfs_buf *bp,
bool check_version)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; struct xfs_mount *mp = bp->b_target->bt_mount;
struct xfs_sb sb; struct xfs_sb sb;
...@@ -686,7 +689,8 @@ xfs_sb_verify( ...@@ -686,7 +689,8 @@ xfs_sb_verify(
* Only check the in progress field for the primary superblock as * Only check the in progress field for the primary superblock as
* mkfs.xfs doesn't clear it from secondary superblocks. * mkfs.xfs doesn't clear it from secondary superblocks.
*/ */
return xfs_mount_validate_sb(mp, &sb, bp->b_bn == XFS_SB_DADDR); return xfs_mount_validate_sb(mp, &sb, bp->b_bn == XFS_SB_DADDR,
check_version);
} }
/* /*
...@@ -719,7 +723,7 @@ xfs_sb_read_verify( ...@@ -719,7 +723,7 @@ xfs_sb_read_verify(
goto out_error; goto out_error;
} }
} }
error = xfs_sb_verify(bp); error = xfs_sb_verify(bp, true);
out_error: out_error:
if (error) { if (error) {
...@@ -758,7 +762,7 @@ xfs_sb_write_verify( ...@@ -758,7 +762,7 @@ xfs_sb_write_verify(
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_fspriv;
int error; int error;
error = xfs_sb_verify(bp); error = xfs_sb_verify(bp, false);
if (error) { if (error) {
XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, bp->b_addr); XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, bp->b_addr);
xfs_buf_ioerror(bp, error); xfs_buf_ioerror(bp, error);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment