xfs: restore speculative_cow_prealloc_lifetime sysctl

In commit 9669f51de5c0 I tried to get rid of the undocumented cow gc
lifetime knob. The knob's function was never documented and it now
doesn't really have a function since eof and cow gc have been
consolidated.

Regrettably, xfs/231 relies on it and regresses on for-next. I did not
succeed at getting far enough through fstests patch review for the fixup
to land in time.

Restore the sysctl knob, document what it did (does?), put it on the
deprecation schedule, and rip out a redundant function.

Fixes: 9669f51de5c0 ("xfs: consolidate the eofblocks and cowblocks workers")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>

+24 -27
+10 -6
Documentation/admin-guide/xfs.rst
··· 284 removes unused preallocation from clean inodes and releases 285 the unused space back to the free pool. 286 287 fs.xfs.error_level (Min: 0 Default: 3 Max: 11) 288 A volume knob for error reporting when internal errors occur. 289 This will generate detailed messages & backtraces for filesystem ··· 359 Deprecated Sysctls 360 ================== 361 362 - =========================== ================ 363 - Name Removal Schedule 364 - =========================== ================ 365 - fs.xfs.irix_sgid_inherit September 2025 366 - fs.xfs.irix_symlink_mode September 2025 367 - =========================== ================ 368 369 370 Removed Sysctls
··· 284 removes unused preallocation from clean inodes and releases 285 the unused space back to the free pool. 286 287 + fs.xfs.speculative_cow_prealloc_lifetime 288 + This is an alias for speculative_prealloc_lifetime. 289 + 290 fs.xfs.error_level (Min: 0 Default: 3 Max: 11) 291 A volume knob for error reporting when internal errors occur. 292 This will generate detailed messages & backtraces for filesystem ··· 356 Deprecated Sysctls 357 ================== 358 359 + =========================================== ================ 360 + Name Removal Schedule 361 + =========================================== ================ 362 + fs.xfs.irix_sgid_inherit September 2025 363 + fs.xfs.irix_symlink_mode September 2025 364 + fs.xfs.speculative_cow_prealloc_lifetime September 2025 365 + =========================================== ================ 366 367 368 Removed Sysctls
+14 -21
fs/xfs/xfs_sysctl.c
··· 51 #endif /* CONFIG_PROC_FS */ 52 53 STATIC int 54 - xfs_deprecate_irix_sgid_inherit_proc_handler( 55 struct ctl_table *ctl, 56 int write, 57 void *buffer, ··· 59 loff_t *ppos) 60 { 61 if (write) { 62 - printk_once(KERN_WARNING 63 - "XFS: " "%s sysctl option is deprecated.\n", 64 - ctl->procname); 65 - } 66 - return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); 67 - } 68 - 69 - STATIC int 70 - xfs_deprecate_irix_symlink_mode_proc_handler( 71 - struct ctl_table *ctl, 72 - int write, 73 - void *buffer, 74 - size_t *lenp, 75 - loff_t *ppos) 76 - { 77 - if (write) { 78 - printk_once(KERN_WARNING 79 - "XFS: " "%s sysctl option is deprecated.\n", 80 ctl->procname); 81 } 82 return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); ··· 72 .data = &xfs_params.sgid_inherit.val, 73 .maxlen = sizeof(int), 74 .mode = 0644, 75 - .proc_handler = xfs_deprecate_irix_sgid_inherit_proc_handler, 76 .extra1 = &xfs_params.sgid_inherit.min, 77 .extra2 = &xfs_params.sgid_inherit.max 78 }, ··· 81 .data = &xfs_params.symlink_mode.val, 82 .maxlen = sizeof(int), 83 .mode = 0644, 84 - .proc_handler = xfs_deprecate_irix_symlink_mode_proc_handler, 85 .extra1 = &xfs_params.symlink_mode.min, 86 .extra2 = &xfs_params.symlink_mode.max 87 }, ··· 182 .maxlen = sizeof(int), 183 .mode = 0644, 184 .proc_handler = proc_dointvec_minmax, 185 .extra1 = &xfs_params.blockgc_timer.min, 186 .extra2 = &xfs_params.blockgc_timer.max, 187 },
··· 51 #endif /* CONFIG_PROC_FS */ 52 53 STATIC int 54 + xfs_deprecated_dointvec_minmax( 55 struct ctl_table *ctl, 56 int write, 57 void *buffer, ··· 59 loff_t *ppos) 60 { 61 if (write) { 62 + printk_ratelimited(KERN_WARNING 63 + "XFS: %s sysctl option is deprecated.\n", 64 ctl->procname); 65 } 66 return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); ··· 88 .data = &xfs_params.sgid_inherit.val, 89 .maxlen = sizeof(int), 90 .mode = 0644, 91 + .proc_handler = xfs_deprecated_dointvec_minmax, 92 .extra1 = &xfs_params.sgid_inherit.min, 93 .extra2 = &xfs_params.sgid_inherit.max 94 }, ··· 97 .data = &xfs_params.symlink_mode.val, 98 .maxlen = sizeof(int), 99 .mode = 0644, 100 + .proc_handler = xfs_deprecated_dointvec_minmax, 101 .extra1 = &xfs_params.symlink_mode.min, 102 .extra2 = &xfs_params.symlink_mode.max 103 }, ··· 198 .maxlen = sizeof(int), 199 .mode = 0644, 200 .proc_handler = proc_dointvec_minmax, 201 + .extra1 = &xfs_params.blockgc_timer.min, 202 + .extra2 = &xfs_params.blockgc_timer.max, 203 + }, 204 + { 205 + .procname = "speculative_cow_prealloc_lifetime", 206 + .data = &xfs_params.blockgc_timer.val, 207 + .maxlen = sizeof(int), 208 + .mode = 0644, 209 + .proc_handler = xfs_deprecated_dointvec_minmax, 210 .extra1 = &xfs_params.blockgc_timer.min, 211 .extra2 = &xfs_params.blockgc_timer.max, 212 },