[1/3] insert_resource can succeed and return an error

From: Matthew Wilcox
Date: Thu Mar 18 2004 - 19:22:11 EST



If we start again, we can return an error even if we were successful.
Reset the result to 0 before beginning again. Why don't we use a
tailcall here?

Index: kernel/resource.c
===================================================================
RCS file: /var/cvs/linux-2.6/kernel/resource.c,v
retrieving revision 1.12
diff -u -p -r1.12 resource.c
--- a/kernel/resource.c 28 Feb 2004 01:51:35 -0000 1.12
+++ b/kernel/resource.c 18 Mar 2004 23:41:01 -0000
@@ -337,6 +337,7 @@ int insert_resource(struct resource *par
/* existing resource overlaps end of new resource */
if (next->end > new->end) {
parent = next;
+ result = 0;
goto begin;
}


--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/