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