Re: [PATCH net-next v3 2/4] netconsole: Initialize configfs_item for default targets

From: Joel Becker
Date: Tue Oct 10 2023 - 15:28:12 EST


On Tue, Oct 10, 2023 at 02:37:49AM -0700, Breno Leitao wrote:
> For netconsole targets allocated during the boot time (passing
> netconsole=... argument), netconsole_target->item is not initialized.
> That is not a problem because it is not used inside configfs.
>
> An upcoming patch will be using it, thus, initialize the targets with
> the name 'cmdline' plus a counter starting from 0. This name will match
> entries in the configfs later.
>
> Suggested-by: Joel Becker <jlbec@xxxxxxxxxxxx>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
> ---
> drivers/net/netconsole.c | 25 +++++++++++++++++++++++--
> 1 file changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
> index d609fb59cf99..3d7002af505d 100644
> --- a/drivers/net/netconsole.c
> +++ b/drivers/net/netconsole.c
> @@ -53,6 +53,8 @@ static bool oops_only = false;
> module_param(oops_only, bool, 0600);
> MODULE_PARM_DESC(oops_only, "Only log oops messages");
>
> +#define NETCONSOLE_PARAM_TARGET_NAME "cmdline"

Perhaps `NETCONSOLE_PARAM_TARGET_PREFIX` is better. Makes it clear this
is not the whole name.

Thanks,
Joel


--

"When I am working on a problem I never think about beauty. I
only think about how to solve the problem. But when I have finished, if
the solution is not beautiful, I know it is wrong."
- Buckminster Fuller

http://www.jlbec.org/
jlbec@xxxxxxxxxxxx