Re: configfs: Create config_item from netconsole
From: Breno Leitao <leitao@debian.org>
Date: 2023-10-02 14:23:56
Hello Joel, On Fri, Sep 29, 2023 at 11:51:43AM -0700, Joel Becker wrote:
On Thu, Sep 28, 2023 at 07:44:58AM -0700, Breno Leitao wrote:
quoted
Should I create a configfs_register_item() to solve this problem?It's an express philosophy of configfs that all lifetimes are controlled by userspace, which is why we don't have such a facility. If hch wants to change this, I defer to his judgement. But I don't think it is necessary.
I am happy the suggestion you gave, so, no need to change this philosophy.
In this fashion, each console created on the command line will get a name of `cmdline0`, `cmdline1`, etc. They will not be part of the configfs tree. If the user comes along later and says `mkdir /sys/kernel/config/netconsole/cmdline1`, the existing `cmdline1` console will be attached to the configfs tree. The user is then free to disable and reconfigure the device.
I am happy with this approach.
There would, of course, be some other corner cases to handle. Do we allow dynamic names that look like command-line names if no command-line parameter exists?
I'd say so, I think `cmdline` targets shouldn't be special if there are not netconsole targets defined at boot time.
Does `rmdir /sys/kernel/config/netconsole/cmdline0` actually delete the command-line console entry, or does it return -EBUSY? And so on.
I've looked at the code and tested, it `cmdline0`could be removed as any other target entry. On top of that, the user can create a new `cmdline0` entry, and, it will be set with the default values for the attributes. I am planning to send a patch based on what you suggested, and we can continue the discuss there. Thanks for the _very_ detailed feedback! Breno