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

Configure Feed

Select the types of activity you want to include in your feed.

xfs: always warn about deprecated mount options

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: stable@vger.kernel.org # v5.13
Fixes: 92cf7d36384b99 ("xfs: Skip repetitive warnings about mount options")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>

authored by

Darrick J. Wong and committed by
Carlos Maiolino
630785bf bd721ec7

+17 -8
+17 -8
fs/xfs/xfs_super.c
··· 1379 1379 static inline void 1380 1380 xfs_fs_warn_deprecated( 1381 1381 struct fs_context *fc, 1382 - struct fs_parameter *param, 1383 - uint64_t flag, 1384 - bool value) 1382 + struct fs_parameter *param) 1385 1383 { 1386 - /* Don't print the warning if reconfiguring and current mount point 1387 - * already had the flag set 1384 + /* 1385 + * Always warn about someone passing in a deprecated mount option. 1386 + * Previously we wouldn't print the warning if we were reconfiguring 1387 + * and current mount point already had the flag set, but that was not 1388 + * the right thing to do. 1389 + * 1390 + * Many distributions mount the root filesystem with no options in the 1391 + * initramfs and rely on mount -a to remount the root fs with the 1392 + * options in fstab. However, the old behavior meant that there would 1393 + * never be a warning about deprecated mount options for the root fs in 1394 + * /etc/fstab. On a single-fs system, that means no warning at all. 1395 + * 1396 + * Compounding this problem are distribution scripts that copy 1397 + * /proc/mounts to fstab, which means that we can't remove mount 1398 + * options unless we're 100% sure they have only ever been advertised 1399 + * in /proc/mounts in response to explicitly provided mount options. 1388 1400 */ 1389 - if ((fc->purpose & FS_CONTEXT_FOR_RECONFIGURE) && 1390 - !!(XFS_M(fc->root->d_sb)->m_features & flag) == value) 1391 - return; 1392 1401 xfs_warn(fc->s_fs_info, "%s mount option is deprecated.", param->key); 1393 1402 } 1394 1403