Netdev List
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: 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>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Johan Hovold <johan@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	driver-core@lists.linux.dev
Subject: [PATCH net-next 1/2] sysfs: facilitate creating an empty directory
Date: Sun, 8 Nov 2026 14:45:05 +0100	[thread overview]
Message-ID: <340683d8-83f5-415b-b54c-b2916817f860@gmail.com> (raw)
In-Reply-To: <0a0a7987-abb2-49c8-bc16-3938233ae9c5@gmail.com>

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);
 		return 0;
 	}
 
-- 
2.56.0


  reply	other threads:[~2026-11-08 13:45 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 ` Heiner Kallweit [this message]
2026-11-08 14:06   ` [PATCH net-next 1/2] " Greg Kroah-Hartman
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=340683d8-83f5-415b-b54c-b2916817f860@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=dakr@kernel.org \
    --cc=davem@davemloft.net \
    --cc=driver-core@lists.linux.dev \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox