Commit e445fba2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'xfs-merge-6.18' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs updates from Carlos Maiolino:
 "For this merge window, there are really no new features, but there are
  a few things worth to emphasize:

   - Deprecated for years already, the (no)attr2 and (no)ikeep mount
     options have been removed for good

   - Several cleanups (specially from typedefs) and bug fixes

   - Improvements made in the online repair reap calculations

   - online fsck is now enabled by default"

* tag 'xfs-merge-6.18' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (53 commits)
  xfs: rework datasync tracking and execution
  xfs: rearrange code in xfs_inode_item_precommit
  xfs: scrub: use kstrdup_const() for metapath scan setups
  xfs: use bt_nr_sectors in xfs_dax_translate_range
  xfs: track the number of blocks in each buftarg
  xfs: constify xfs_errortag_random_default
  xfs: improve default maximum number of open zones
  xfs: improve zone statistics message
  xfs: centralize error tag definitions
  xfs: remove pointless externs in xfs_error.h
  xfs: remove the expr argument to XFS_TEST_ERROR
  xfs: remove xfs_errortag_set
  xfs: remove xfs_errortag_get
  xfs: move the XLOG_REG_ constants out of xfs_log_format.h
  xfs: adjust the hint based zone allocation policy
  xfs: refactor hint based zone allocation
  fs: add an enum for number of life time hints
  xfs: fix log CRC mismatches between i386 and other architectures
  xfs: rename the old_crc variable in xlog_recover_process
  xfs: remove the unused xfs_log_iovec_t typedef
  ...
parents a40eb50a c91d38b5
Loading
Loading
Loading
Loading
+14 −55
Original line number Diff line number Diff line
@@ -34,22 +34,6 @@ When mounting an XFS filesystem, the following options are accepted.
	to the file. Specifying a fixed ``allocsize`` value turns off
	the dynamic behaviour.

  attr2 or noattr2
	The options enable/disable an "opportunistic" improvement to
	be made in the way inline extended attributes are stored
	on-disk.  When the new form is used for the first time when
	``attr2`` is selected (either when setting or removing extended
	attributes) the on-disk superblock feature bit field will be
	updated to reflect this format being in use.

	The default behaviour is determined by the on-disk feature
	bit indicating that ``attr2`` behaviour is active. If either
	mount option is set, then that becomes the new default used
	by the filesystem.

	CRC enabled filesystems always use the ``attr2`` format, and so
	will reject the ``noattr2`` mount option if it is set.

  discard or nodiscard (default)
	Enable/disable the issuing of commands to let the block
	device reclaim space freed by the filesystem.  This is
@@ -75,12 +59,6 @@ When mounting an XFS filesystem, the following options are accepted.
	across the entire filesystem rather than just on directories
	configured to use it.

  ikeep or noikeep (default)
	When ``ikeep`` is specified, XFS does not delete empty inode
	clusters and keeps them around on disk.  When ``noikeep`` is
	specified, empty inode clusters are returned to the free
	space pool.

  inode32 or inode64 (default)
	When ``inode32`` is specified, it indicates that XFS limits
	inode creation to locations which will not result in inode
@@ -253,9 +231,8 @@ latest version and try again.

The deprecation will take place in two parts.  Support for mounting V4
filesystems can now be disabled at kernel build time via Kconfig option.
The option will default to yes until September 2025, at which time it
will be changed to default to no.  In September 2030, support will be
removed from the codebase entirely.
These options were changed to default to no in September 2025.  In
September 2030, support will be removed from the codebase entirely.

Note: Distributors may choose to withdraw V4 format support earlier than
the dates listed above.
@@ -268,8 +245,6 @@ Deprecated Mount Options
============================    ================
Mounting with V4 filesystem     September 2030
Mounting ascii-ci filesystem    September 2030
ikeep/noikeep			September 2025
attr2/noattr2			September 2025
============================    ================


@@ -285,6 +260,8 @@ Removed Mount Options
  osyncisdsync/osyncisosync	v4.0
  barrier			v4.19
  nobarrier			v4.19
  ikeep/noikeep			v6.18
  attr2/noattr2			v6.18
===========================     =======

sysctls
@@ -312,9 +289,6 @@ The following sysctls are available for the XFS filesystem:
	removes unused preallocation from clean inodes and releases
	the unused space back to the free pool.

  fs.xfs.speculative_cow_prealloc_lifetime
	This is an alias for speculative_prealloc_lifetime.

  fs.xfs.error_level		(Min: 0  Default: 3  Max: 11)
	A volume knob for error reporting when internal errors occur.
	This will generate detailed messages & backtraces for filesystem
@@ -341,17 +315,6 @@ The following sysctls are available for the XFS filesystem:

	This option is intended for debugging only.

  fs.xfs.irix_symlink_mode	(Min: 0  Default: 0  Max: 1)
	Controls whether symlinks are created with mode 0777 (default)
	or whether their mode is affected by the umask (irix mode).

  fs.xfs.irix_sgid_inherit	(Min: 0  Default: 0  Max: 1)
	Controls files created in SGID directories.
	If the group ID of the new file does not match the effective group
	ID or one of the supplementary group IDs of the parent dir, the
	ISGID bit is cleared if the irix_sgid_inherit compatibility sysctl
	is set.

  fs.xfs.inherit_sync		(Min: 0  Default: 1  Max: 1)
	Setting this to "1" will cause the "sync" flag set
	by the **xfs_io(8)** chattr command on a directory to be
@@ -387,24 +350,20 @@ The following sysctls are available for the XFS filesystem:
Deprecated Sysctls
==================

===========================================     ================
  Name                                          Removal Schedule
===========================================     ================
fs.xfs.irix_sgid_inherit                        September 2025
fs.xfs.irix_symlink_mode                        September 2025
fs.xfs.speculative_cow_prealloc_lifetime        September 2025
===========================================     ================

None currently.

Removed Sysctls
===============

=============================	=======
==========================================   =======
  Name                                       Removed
=============================	=======
==========================================   =======
  fs.xfs.xfsbufd_centisec                    v4.0
  fs.xfs.age_buffer_centisecs                v4.0
=============================	=======
  fs.xfs.irix_symlink_mode                   v6.18
  fs.xfs.irix_sgid_inherit                   v6.18
  fs.xfs.speculative_cow_prealloc_lifetime   v6.18
==========================================   =======

Error handling
==============
+6 −16
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ config XFS_FS
config XFS_SUPPORT_V4
	bool "Support deprecated V4 (crc=0) format"
	depends on XFS_FS
	default y
	default n
	help
	  The V4 filesystem format lacks certain features that are supported
	  by the V5 format, such as metadata checksumming, strengthened
@@ -40,7 +40,7 @@ config XFS_SUPPORT_V4
	  filesystem is a V4 filesystem.  If no such string is found, please
	  upgrade xfsprogs to the latest version and try again.

	  This option will become default N in September 2025.  Support for the
	  This option became default N in September 2025.  Support for the
	  V4 format will be removed entirely in September 2030.  Distributors
	  can say N here to withdraw support earlier.

@@ -50,7 +50,7 @@ config XFS_SUPPORT_V4
config XFS_SUPPORT_ASCII_CI
	bool "Support deprecated case-insensitive ascii (ascii-ci=1) format"
	depends on XFS_FS
	default y
	default n
	help
	  The ASCII case insensitivity filesystem feature only works correctly
	  on systems that have been coerced into using ISO 8859-1, and it does
@@ -67,7 +67,7 @@ config XFS_SUPPORT_ASCII_CI
	  filesystem is a case-insensitive filesystem.  If no such string is
	  found, please upgrade xfsprogs to the latest version and try again.

	  This option will become default N in September 2025.  Support for the
	  This option became default N in September 2025.  Support for the
	  feature will be removed entirely in September 2030.  Distributors
	  can say N here to withdraw support earlier.

@@ -137,7 +137,7 @@ config XFS_BTREE_IN_MEM

config XFS_ONLINE_SCRUB
	bool "XFS online metadata check support"
	default n
	default y
	depends on XFS_FS
	depends on TMPFS && SHMEM
	select XFS_LIVE_HOOKS
@@ -150,12 +150,8 @@ config XFS_ONLINE_SCRUB
	  advantage here is to look for problems proactively so that
	  they can be dealt with in a controlled manner.

	  This feature is considered EXPERIMENTAL.  Use with caution!

	  See the xfs_scrub man page in section 8 for additional information.

	  If unsure, say N.

config XFS_ONLINE_SCRUB_STATS
	bool "XFS online metadata check usage data collection"
	default y
@@ -171,11 +167,9 @@ config XFS_ONLINE_SCRUB_STATS

	  Usage data are collected in /sys/kernel/debug/xfs/scrub.

	  If unsure, say N.

config XFS_ONLINE_REPAIR
	bool "XFS online metadata repair support"
	default n
	default y
	depends on XFS_FS && XFS_ONLINE_SCRUB
	select XFS_BTREE_IN_MEM
	help
@@ -186,12 +180,8 @@ config XFS_ONLINE_REPAIR
	  formatted with secondary metadata, such as reverse mappings and inode
	  parent pointers.

	  This feature is considered EXPERIMENTAL.  Use with caution!

	  See the xfs_scrub man page in section 8 for additional information.

	  If unsure, say N.

config XFS_WARN
	bool "XFS Verbose Warnings"
	depends on XFS_FS && !XFS_DEBUG
+3 −4
Original line number Diff line number Diff line
@@ -92,9 +92,8 @@ xfs_ag_resv_critical(
	trace_xfs_ag_resv_critical(pag, type, avail);

	/* Critically low if less than 10% or max btree height remains. */
	return XFS_TEST_ERROR(avail < orig / 10 ||
			      avail < mp->m_agbtree_maxlevels,
			mp, XFS_ERRTAG_AG_RESV_CRITICAL);
	return avail < orig / 10 || avail < mp->m_agbtree_maxlevels ||
		XFS_TEST_ERROR(mp, XFS_ERRTAG_AG_RESV_CRITICAL);
}

/*
@@ -203,7 +202,7 @@ __xfs_ag_resv_init(
		return -EINVAL;
	}

	if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_AG_RESV_FAIL))
	if (XFS_TEST_ERROR(mp, XFS_ERRTAG_AG_RESV_FAIL))
		error = -ENOSPC;
	else
		error = xfs_dec_fdblocks(mp, hidden_space, true);
+2 −3
Original line number Diff line number Diff line
@@ -3321,7 +3321,7 @@ xfs_agf_read_verify(
		xfs_verifier_error(bp, -EFSBADCRC, __this_address);
	else {
		fa = xfs_agf_verify(bp);
		if (XFS_TEST_ERROR(fa, mp, XFS_ERRTAG_ALLOC_READ_AGF))
		if (fa || XFS_TEST_ERROR(mp, XFS_ERRTAG_ALLOC_READ_AGF))
			xfs_verifier_error(bp, -EFSCORRUPTED, fa);
	}
}
@@ -4019,8 +4019,7 @@ __xfs_free_extent(
	ASSERT(len != 0);
	ASSERT(type != XFS_AG_RESV_AGFL);

	if (XFS_TEST_ERROR(false, mp,
			XFS_ERRTAG_FREE_EXTENT))
	if (XFS_TEST_ERROR(mp, XFS_ERRTAG_FREE_EXTENT))
		return -EIO;

	error = xfs_free_extent_fix_freelist(tp, pag, &agbp);
+6 −19
Original line number Diff line number Diff line
@@ -667,12 +667,8 @@ xfs_attr_shortform_bytesfit(

	/*
	 * For attr2 we can try to move the forkoff if there is space in the
	 * literal area, but for the old format we are done if there is no
	 * space in the fixed attribute fork.
	 * literal area
	 */
	if (!xfs_has_attr2(mp))
		return 0;

	dsize = dp->i_df.if_bytes;

	switch (dp->i_df.if_format) {
@@ -723,22 +719,16 @@ xfs_attr_shortform_bytesfit(
}

/*
 * Switch on the ATTR2 superblock bit (implies also FEATURES2) unless:
 * - noattr2 mount option is set,
 * - on-disk version bit says it is already set, or
 * - the attr2 mount option is not set to enable automatic upgrade from attr1.
 * Switch on the ATTR2 superblock bit (implies also FEATURES2) unless
 * on-disk version bit says it is already set
 */
STATIC void
xfs_sbversion_add_attr2(
	struct xfs_mount	*mp,
	struct xfs_trans	*tp)
{
	if (xfs_has_noattr2(mp))
		return;
	if (mp->m_sb.sb_features2 & XFS_SB_VERSION2_ATTR2BIT)
		return;
	if (!xfs_has_attr2(mp))
		return;

	spin_lock(&mp->m_sb_lock);
	xfs_add_attr2(mp);
@@ -889,7 +879,7 @@ xfs_attr_sf_removename(
	/*
	 * Fix up the start offset of the attribute fork
	 */
	if (totsize == sizeof(struct xfs_attr_sf_hdr) && xfs_has_attr2(mp) &&
	if (totsize == sizeof(struct xfs_attr_sf_hdr) &&
	    (dp->i_df.if_format != XFS_DINODE_FMT_BTREE) &&
	    !(args->op_flags & (XFS_DA_OP_ADDNAME | XFS_DA_OP_REPLACE)) &&
	    !xfs_has_parent(mp)) {
@@ -900,7 +890,6 @@ xfs_attr_sf_removename(
		ASSERT(dp->i_forkoff);
		ASSERT(totsize > sizeof(struct xfs_attr_sf_hdr) ||
				(args->op_flags & XFS_DA_OP_ADDNAME) ||
				!xfs_has_attr2(mp) ||
				dp->i_df.if_format == XFS_DINODE_FMT_BTREE ||
				xfs_has_parent(mp));
		xfs_trans_log_inode(args->trans, dp,
@@ -1040,8 +1029,7 @@ xfs_attr_shortform_allfit(
		bytes += xfs_attr_sf_entsize_byname(name_loc->namelen,
					be16_to_cpu(name_loc->valuelen));
	}
	if (xfs_has_attr2(dp->i_mount) &&
	    (dp->i_df.if_format != XFS_DINODE_FMT_BTREE) &&
	if ((dp->i_df.if_format != XFS_DINODE_FMT_BTREE) &&
	    (bytes == sizeof(struct xfs_attr_sf_hdr)))
		return -1;
	return xfs_attr_shortform_bytesfit(dp, bytes);
@@ -1161,7 +1149,6 @@ xfs_attr3_leaf_to_shortform(
		 * this case.
		 */
		if (!(args->op_flags & XFS_DA_OP_REPLACE)) {
			ASSERT(xfs_has_attr2(dp->i_mount));
			ASSERT(dp->i_df.if_format != XFS_DINODE_FMT_BTREE);
			xfs_attr_fork_remove(dp, args->trans);
		}
@@ -1225,7 +1212,7 @@ xfs_attr3_leaf_to_node(

	trace_xfs_attr_leaf_to_node(args);

	if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_ATTR_LEAF_TO_NODE)) {
	if (XFS_TEST_ERROR(mp, XFS_ERRTAG_ATTR_LEAF_TO_NODE)) {
		error = -EIO;
		goto out;
	}
Loading