Skip to content

Commit 92cf7d3

Browse files
preichlDarrick J. Wong
authored andcommitted
xfs: Skip repetitive warnings about mount options
Skip the warnings about mount option being deprecated if we are remounting and deprecated option state is not changing. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211605 Fix-suggested-by: Eric Sandeen <[email protected]> Signed-off-by: Pavel Reichl <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 0f98b4e commit 92cf7d3

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

fs/xfs/xfs_super.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,22 @@ suffix_kstrtoint(
11261126
return ret;
11271127
}
11281128

1129+
static inline void
1130+
xfs_fs_warn_deprecated(
1131+
struct fs_context *fc,
1132+
struct fs_parameter *param,
1133+
uint64_t flag,
1134+
bool value)
1135+
{
1136+
/* Don't print the warning if reconfiguring and current mount point
1137+
* already had the flag set
1138+
*/
1139+
if ((fc->purpose & FS_CONTEXT_FOR_RECONFIGURE) &&
1140+
!!(XFS_M(fc->root->d_sb)->m_flags & flag) == value)
1141+
return;
1142+
xfs_warn(fc->s_fs_info, "%s mount option is deprecated.", param->key);
1143+
}
1144+
11291145
/*
11301146
* Set mount state from a mount option.
11311147
*
@@ -1265,19 +1281,19 @@ xfs_fs_parse_param(
12651281
#endif
12661282
/* Following mount options will be removed in September 2025 */
12671283
case Opt_ikeep:
1268-
xfs_warn(parsing_mp, "%s mount option is deprecated.", param->key);
1284+
xfs_fs_warn_deprecated(fc, param, XFS_MOUNT_IKEEP, true);
12691285
parsing_mp->m_flags |= XFS_MOUNT_IKEEP;
12701286
return 0;
12711287
case Opt_noikeep:
1272-
xfs_warn(parsing_mp, "%s mount option is deprecated.", param->key);
1288+
xfs_fs_warn_deprecated(fc, param, XFS_MOUNT_IKEEP, false);
12731289
parsing_mp->m_flags &= ~XFS_MOUNT_IKEEP;
12741290
return 0;
12751291
case Opt_attr2:
1276-
xfs_warn(parsing_mp, "%s mount option is deprecated.", param->key);
1292+
xfs_fs_warn_deprecated(fc, param, XFS_MOUNT_ATTR2, true);
12771293
parsing_mp->m_flags |= XFS_MOUNT_ATTR2;
12781294
return 0;
12791295
case Opt_noattr2:
1280-
xfs_warn(parsing_mp, "%s mount option is deprecated.", param->key);
1296+
xfs_fs_warn_deprecated(fc, param, XFS_MOUNT_NOATTR2, true);
12811297
parsing_mp->m_flags &= ~XFS_MOUNT_ATTR2;
12821298
parsing_mp->m_flags |= XFS_MOUNT_NOATTR2;
12831299
return 0;

0 commit comments

Comments
 (0)