Skip to content

Commit 3451018

Browse files
Dave ChinnerBen Myers
authored andcommitted
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: Dave Chinner <[email protected]> Reviewed-by: Brian Foster <[email protected]> Signed-off-by: Ben Myers <[email protected]>
1 parent ad1858d commit 3451018

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

fs/xfs/xfs_mount.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ STATIC int
314314
xfs_mount_validate_sb(
315315
xfs_mount_t *mp,
316316
xfs_sb_t *sbp,
317-
bool check_inprogress)
317+
bool check_inprogress,
318+
bool check_version)
318319
{
319320

320321
/*
@@ -337,9 +338,10 @@ xfs_mount_validate_sb(
337338

338339
/*
339340
* 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.
341343
*/
342-
if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) {
344+
if (check_version && XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) {
343345
xfs_alert(mp,
344346
"Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!\n"
345347
"Use of these features in this kernel is at your own risk!");
@@ -675,7 +677,8 @@ xfs_sb_to_disk(
675677

676678
static int
677679
xfs_sb_verify(
678-
struct xfs_buf *bp)
680+
struct xfs_buf *bp,
681+
bool check_version)
679682
{
680683
struct xfs_mount *mp = bp->b_target->bt_mount;
681684
struct xfs_sb sb;
@@ -686,7 +689,8 @@ xfs_sb_verify(
686689
* Only check the in progress field for the primary superblock as
687690
* mkfs.xfs doesn't clear it from secondary superblocks.
688691
*/
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);
690694
}
691695

692696
/*
@@ -719,7 +723,7 @@ xfs_sb_read_verify(
719723
goto out_error;
720724
}
721725
}
722-
error = xfs_sb_verify(bp);
726+
error = xfs_sb_verify(bp, true);
723727

724728
out_error:
725729
if (error) {
@@ -758,7 +762,7 @@ xfs_sb_write_verify(
758762
struct xfs_buf_log_item *bip = bp->b_fspriv;
759763
int error;
760764

761-
error = xfs_sb_verify(bp);
765+
error = xfs_sb_verify(bp, false);
762766
if (error) {
763767
XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, bp->b_addr);
764768
xfs_buf_ioerror(bp, error);

0 commit comments

Comments
 (0)