Re: [PATCH] debugfs: clarify return values when disabled

From: Danilo Krummrich

Date: Mon Oct 12 2026 - 18:37:40 EST


On Thu Oct 8, 2026 at 7:15 PM CEST, Randy Dunlap wrote:
> @@ -820,6 +826,10 @@ EXPORT_SYMBOL_GPL(debugfs_lookup_and_rem
> *
> * If debugfs is not enabled in the kernel, the value -%ENODEV will be
> * returned.
> + * If debugfs is not enabled in the kernel build, the value %-ENODEV
> + * will be returned. If debugfs is enabled in the kernel build but is disabled
> + * by using "debugfs=off" on the kernel command line, the value %-EPERM
> + * will be returned.

This keeps the old *and* the new text.

Besides that, when debugfs is disabled via kernel command line
debugfs_change_name() checks

if (IS_ERR_OR_NULL(dentry))
return 0;

and if disabled via kernel command line dentry would have been an ERR_PTR and
hence it would just return 0.

(There may be more functions of this sort, I didn't check all of them.)

Thanks,
Danilo