diff options
authorMatthew Wilcox <>2019-07-19 00:07:01 +0000
committerJohannes Weiner <>2019-07-19 00:07:01 +0000
commite4ab488f74ec1b7ba3f4631dad010ffa89ed0e97 (patch)
parent798c8bf486634f68ce153c0db88d5c376d61c450 (diff)
Releasing resources with children
What does it mean to release a resource with children? Should the children become children of the released resource's parent? Should they be released too? Should we fail the release? I bet we have no callers who expect this right now, but with insert_resource() we may get some. At the point where someone hits this BUG we can figure out what semantics we want. Signed-off-by: Matthew Wilcox <> Cc: Matthew Wilcox <> Signed-off-by: Andrew Morton <>
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index 6eff1a743d8c..02ad13f53306 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -222,6 +222,8 @@ static int __release_resource(struct resource *old, bool release_child)
+ WARN_ON(old->child);
p = &old->parent->child;
for (;;) {
tmp = *p;