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

From: Breno Leitao
Date: Wed Oct 11 2023 - 08:38:54 EST


On Tue, Oct 10, 2023 at 12:27:34PM -0700, Joel Becker wrote:
> 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.

Sure, I can replace it by NETCONSOLE_PARAM_TARGET_PREFIX. I used
`NETCONSOLE_PARAM_TARGET_NAME` because you had suggested it in the past:

https://lore.kernel.org/all/ZR3EKnepIOKlVGgZ@xxxxxxxxxx/

Let me update and send a new version.