Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: relocate sparse inode mount warning

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>

authored by

Brian Foster and committed by
Dave Chinner
1b867d3a 92863451

+4 -3
-3
fs/xfs/libxfs/xfs_sb.c
··· 182 182 if (xfs_sb_version_hassparseinodes(sbp)) { 183 183 uint32_t align; 184 184 185 - xfs_alert(mp, 186 - "EXPERIMENTAL sparse inode feature enabled. Use at your own risk!"); 187 - 188 185 align = XFS_INODES_PER_CHUNK * sbp->sb_inodesize 189 186 >> sbp->sb_blocklog; 190 187 if (sbp->sb_inoalignmt != align) {
+4
fs/xfs/xfs_super.c
··· 1528 1528 } 1529 1529 } 1530 1530 1531 + if (xfs_sb_version_hassparseinodes(&mp->m_sb)) 1532 + xfs_alert(mp, 1533 + "EXPERIMENTAL sparse inode feature enabled. Use at your own risk!"); 1534 + 1531 1535 error = xfs_mountfs(mp); 1532 1536 if (error) 1533 1537 goto out_filestream_unmount;