Re: [PATCH] kobject: hide illegible sysfs warning of kobject_del()

From: Greg Kroah-Hartman
Date: Fri Nov 11 2022 - 01:31:04 EST


On Fri, Nov 11, 2022 at 02:58:07PM +0800, Liu Shixin wrote:
> Some consumers do not care whether kobject_add() succeed or failed such as
> irqdesc. They call kobject_del() all the time even if kobject_add() failed.
> Then kernel will report some illegible sysfs warning like this:
>
> kernfs: can not remove 'actions', no directory
> WARNING: CPU: 0 PID: 277 at fs/kernfs/dir.c:1615 kernfs_remove_by_name_ns+0xd5/0xe0

Why not fix the caller here? Is that somehow not possible?

thanks,

greg k-h