xfs: relocate sparse inode mount warning
authorBrian Foster <bfoster@redhat.com>
Wed, 19 Aug 2015 00:32:14 +0000 (10:32 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 19 Aug 2015 00:32:14 +0000 (10:32 +1000)
The sparse inodes feature is currently considered experimental. We warn
at mount time from xfs_mount_validate_sb(). This function is part of the
superblock verifier codepath, however, which means it could be invoked
repeatedly on superblock reads or writes. This is currently only
noticeable from userspace, where mkfs produces multiple warnings at
format time.

As mkfs warnings were not the intent of this change, relocate the mount
time warning to xfs_fs_fill_super(), which is only invoked once and only
in kernel space.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_sb.c
fs/xfs/xfs_super.c

index 0f5e08fe64a2c93b4d0298cdb201a6f2e9ee8c14..9c87f66ab929b17774300e4aca198d4daec91819 100644 (file)
@@ -182,9 +182,6 @@ xfs_mount_validate_sb(
        if (xfs_sb_version_hassparseinodes(sbp)) {
                uint32_t        align;
 
-               xfs_alert(mp,
-       "EXPERIMENTAL sparse inode feature enabled. Use at your own risk!");
-
                align = XFS_INODES_PER_CHUNK * sbp->sb_inodesize
                                >> sbp->sb_blocklog;
                if (sbp->sb_inoalignmt != align) {
index 1fb16562c159947ac27adae43f6abb4f195e1cfa..f98ce83b7bc4f2587ba3d3eb091fec163936a4ef 100644 (file)
@@ -1528,6 +1528,10 @@ xfs_fs_fill_super(
                }
        }
 
+       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+               xfs_alert(mp,
+       "EXPERIMENTAL sparse inode feature enabled. Use at your own risk!");
+
        error = xfs_mountfs(mp);
        if (error)
                goto out_filestream_unmount;