[PATCH 1/8] fs/configfs: rework configfs_is_root()

Hannes Reinecke hare at kernel.org
Sat Jun 13 04:14:30 PDT 2026


From: Hannes Reinecke <hare at suse.de>

configfs_is_root() should not check for static structures, but
use the information in the structure itself.

Signed-off-by: Hannes Reinecke <hare at suse.de>
---
 fs/configfs/mount.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index 4929f3431189..e5c01d5e4d2d 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -49,7 +49,9 @@ static struct config_group configfs_root_group = {
 
 int configfs_is_root(struct config_item *item)
 {
-	return item == &configfs_root_group.cg_item;
+	struct configfs_dirent *sd =
+		item->ci_dentry->d_fsdata;
+	return sd->s_type == CONFIGFS_ROOT;
 }
 
 static struct configfs_dirent configfs_root = {
-- 
2.51.0




More information about the Linux-nvme mailing list