<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: willy@parisc-linux.org (Matthew Wilcox)

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 &lt;willy@parisc-linux.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/kernel/resource.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN kernel/resource.c~releasing-resources-with-children kernel/resource.c
--- 25/kernel/resource.c~releasing-resources-with-children	2005-04-02 00:21:52.000000000 -0800
+++ 25-akpm/kernel/resource.c	2005-04-02 00:22:22.000000000 -0800
@@ -181,6 +181,8 @@ static int __release_resource(struct res
 {
 	struct resource *tmp, **p;
 
+	WARN_ON(old-&gt;child);
+
 	p = &amp;old-&gt;parent-&gt;child;
 	for (;;) {
 		tmp = *p;
_
</pre></body></html>