Skip to content

Commit 1dae549

Browse files
Darrick J. Wonggregkh
authored andcommitted
xfs: always warn about deprecated mount options
[ Upstream commit 630785b ] The deprecation of the 'attr2' mount option in 6.18 wasn't entirely successful because nobody noticed that the kernel never printed a warning about attr2 being set in fstab if the only xfs filesystem is the root fs; the initramfs mounts the root fs with no mount options; and the init scripts only conveyed the fstab options by remounting the root fs. Fix this by making it complain all the time. Cc: [email protected] # v5.13 Fixes: 92cf7d3 ("xfs: Skip repetitive warnings about mount options") Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]> [ Update existing xfs_fs_warn_deprecated() callers ] Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5ff5765 commit 1dae549

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

fs/xfs/xfs_super.c

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,16 +1232,25 @@ suffix_kstrtoint(
12321232
static inline void
12331233
xfs_fs_warn_deprecated(
12341234
struct fs_context *fc,
1235-
struct fs_parameter *param,
1236-
uint64_t flag,
1237-
bool value)
1235+
struct fs_parameter *param)
12381236
{
1239-
/* Don't print the warning if reconfiguring and current mount point
1240-
* already had the flag set
1237+
/*
1238+
* Always warn about someone passing in a deprecated mount option.
1239+
* Previously we wouldn't print the warning if we were reconfiguring
1240+
* and current mount point already had the flag set, but that was not
1241+
* the right thing to do.
1242+
*
1243+
* Many distributions mount the root filesystem with no options in the
1244+
* initramfs and rely on mount -a to remount the root fs with the
1245+
* options in fstab. However, the old behavior meant that there would
1246+
* never be a warning about deprecated mount options for the root fs in
1247+
* /etc/fstab. On a single-fs system, that means no warning at all.
1248+
*
1249+
* Compounding this problem are distribution scripts that copy
1250+
* /proc/mounts to fstab, which means that we can't remove mount
1251+
* options unless we're 100% sure they have only ever been advertised
1252+
* in /proc/mounts in response to explicitly provided mount options.
12411253
*/
1242-
if ((fc->purpose & FS_CONTEXT_FOR_RECONFIGURE) &&
1243-
!!(XFS_M(fc->root->d_sb)->m_features & flag) == value)
1244-
return;
12451254
xfs_warn(fc->s_fs_info, "%s mount option is deprecated.", param->key);
12461255
}
12471256

@@ -1380,19 +1389,19 @@ xfs_fs_parse_param(
13801389
#endif
13811390
/* Following mount options will be removed in September 2025 */
13821391
case Opt_ikeep:
1383-
xfs_fs_warn_deprecated(fc, param, XFS_FEAT_IKEEP, true);
1392+
xfs_fs_warn_deprecated(fc, param);
13841393
parsing_mp->m_features |= XFS_FEAT_IKEEP;
13851394
return 0;
13861395
case Opt_noikeep:
1387-
xfs_fs_warn_deprecated(fc, param, XFS_FEAT_IKEEP, false);
1396+
xfs_fs_warn_deprecated(fc, param);
13881397
parsing_mp->m_features &= ~XFS_FEAT_IKEEP;
13891398
return 0;
13901399
case Opt_attr2:
1391-
xfs_fs_warn_deprecated(fc, param, XFS_FEAT_ATTR2, true);
1400+
xfs_fs_warn_deprecated(fc, param);
13921401
parsing_mp->m_features |= XFS_FEAT_ATTR2;
13931402
return 0;
13941403
case Opt_noattr2:
1395-
xfs_fs_warn_deprecated(fc, param, XFS_FEAT_NOATTR2, true);
1404+
xfs_fs_warn_deprecated(fc, param);
13961405
parsing_mp->m_features |= XFS_FEAT_NOATTR2;
13971406
return 0;
13981407
default:

0 commit comments

Comments
 (0)