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

From: Randy Dunlap

Date: Mon Oct 19 2026 - 18:02:15 EST




On 10/12/26 3:37 PM, Danilo Krummrich wrote:
> 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.

Thanks for catching that one.

> 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.)

Yes, I'll check all of the exported functions for similar handling.

--
~Randy