Skip to contentSkip to conversation

memcg-mem_cgroup_get_from_ino-returns-null-on-error.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jan 27

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: memcg: mem_cgroup_get_from_ino() returns NULL on error
has been removed from the -mm tree. Its filename was
memcg-mem_cgroup_get_from_ino-returns-null-on-error.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Shakeel Butt <[email protected]>
Subject: memcg: mem_cgroup_get_from_ino() returns NULL on error
Date: Thu, 25 Dec 2025 15:21:11 -0800

Change mem_cgroup_get_from_ino() to return NULL on error instead of ERR_PTR values. This simplifies the API: NULL indicates failure, and a valid pointer indicates success with a CSS reference held that the caller must release via mem_cgroup_put().

Cc Axel Rasmussen <[email protected]>
Cc Dave Chinner <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Muchun Song <[email protected]>
Cc Qi Zheng <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc SeongJae Park <[email protected]>
Cc Wei Xu <[email protected]>
Cc Yuanchu Xie <[email protected]>

---

 mm/memcontrol.c     |    6 ++----
 mm/shrinker_debug.c |    2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)
mm/memcontrol.c renamed from mm/memcontrol.c~memcg-mem_cgroup_get_from_ino-returns-null-on-error +2 -4
@@ -3624,17 +3624,15 @@ struct mem_cgroup *mem_cgroup_get_from_i
 {
 	struct cgroup *cgrp;
 	struct cgroup_subsys_state *css;
-	struct mem_cgroup *memcg;
+	struct mem_cgroup *memcg = NULL;
 
 	cgrp = cgroup_get_from_id(ino);
 	if (IS_ERR(cgrp))
-		return ERR_CAST(cgrp);
+		return NULL;
 
 	css = cgroup_get_e_css(cgrp, &memory_cgrp_subsys);
 	if (css)
 		memcg = container_of(css, struct mem_cgroup, css);
-	else
-		memcg = ERR_PTR(-ENOENT);
 
 	cgroup_put(cgrp);
 
mm/shrinker_debug.c renamed from mm/shrinker_debug.c~memcg-mem_cgroup_get_from_ino-returns-null-on-error +1 -1
@@ -130,7 +130,7 @@ static ssize_t shrinker_debugfs_scan_wri
 
 	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
 		memcg = mem_cgroup_get_from_ino(ino);
-		if (!memcg || IS_ERR(memcg))
+		if (!memcg)
 			return -ENOENT;
 
 		if (!mem_cgroup_online(memcg)) {

_

Patches currently in -mm which might be from [email protected] are