All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Johan Hovold <johan@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	driver-core@lists.linux.dev
Subject: Re: [PATCH net-next 1/2] sysfs: facilitate creating an empty directory
Date: Sun, 8 Nov 2026 09:06:13 -0500	[thread overview]
Message-ID: <2026110846-iphone-alarm-134f@gregkh> (raw)
In-Reply-To: <340683d8-83f5-415b-b54c-b2916817f860@gmail.com>

On Sun, Nov 08, 2026 at 02:45:05PM +0100, Heiner Kallweit wrote:
> We have use cases where an empty sysfs directory is created.
> This requires an attribute list consisting of only the sentinal entry.
> It takes only to modify one check to enable creating an empty directory
> with a NULL attribute list.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  fs/sysfs/group.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
> index 4e1e4f18a16..031cb6f36b5 100644
> --- a/fs/sysfs/group.c
> +++ b/fs/sysfs/group.c
> @@ -141,9 +141,10 @@ static int internal_create_group(struct kobject *kobj, int update,
>  	if (unlikely(update && !kobj->sd))
>  		return -EINVAL;
>  
> -	if (!grp->attrs && !grp->bin_attrs) {
> -		pr_debug("sysfs: (bin_)attrs not set by subsystem for group: %s/%s, skipping\n",
> -			 kobj->name, grp->name ?: "");
> +	/* If name is set w/o attributes, create an empty directory */
> +	if (!grp->name && !grp->attrs && !grp->bin_attrs) {
> +		pr_debug("sysfs: (bin_)attrs not set by subsystem for group: %s, skipping\n",
> +			 kobj->name);

Where is this now documented?

And why would you ever want to make a directory with nothing in it?
That is not how sysfs should be working.

thanks,

greg k-h

  reply	other threads:[~2026-11-08 14:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 13:44 [PATCH net-next 0/2] sysfs: facilitate creating an empty directory Heiner Kallweit
2026-11-08 13:45 ` [PATCH net-next 1/2] " Heiner Kallweit
2026-11-08 14:06   ` Greg Kroah-Hartman [this message]
2026-11-09 13:48   ` netdev-bot+sashiko
2026-11-08 13:46 ` [PATCH net-next 2/2] net sysfs: simplify creating empty wireless directory Heiner Kallweit
2026-11-08 14:06   ` Greg Kroah-Hartman
2026-11-08 14:12     ` Heiner Kallweit
2026-11-08 14:21       ` Greg Kroah-Hartman
2026-11-08 16:02         ` Heiner Kallweit
2026-11-09 13:48   ` netdev-bot+sashiko
2026-11-08 16:12 ` [PATCH net-next 0/2] sysfs: facilitate creating an empty directory Heiner Kallweit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026110846-iphone-alarm-134f@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=dakr@kernel.org \
    --cc=davem@davemloft.net \
    --cc=driver-core@lists.linux.dev \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=johan@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.