Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 149651 Details for
Bug 212121
rgmanager stops the resources in wrong order
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch.
rgmanager-212121.patch (text/plain), 8.12 KB, created by
Lon Hohberger
on 2007-03-08 22:28:00 UTC
(
hide
)
Description:
Patch.
Filename:
MIME Type:
Creator:
Lon Hohberger
Created:
2007-03-08 22:28:00 UTC
Size:
8.12 KB
patch
obsolete
>Index: include/list.h >=================================================================== >RCS file: /cvs/cluster/cluster/rgmanager/include/list.h,v >retrieving revision 1.2.2.2 >diff -u -r1.2.2.2 list.h >--- include/list.h 12 May 2006 21:28:30 -0000 1.2.2.2 >+++ include/list.h 8 Mar 2007 22:26:45 -0000 >@@ -29,6 +29,14 @@ > } \ > } while (0) > >+ >+#define list_prepend(list, newnode) \ >+do { \ >+ list_insert(list, newnode); \ >+ *list = newnode; \ >+} while (0) >+ >+ > #define list_remove(list, oldnode) \ > do { \ > if (le(oldnode) == le(*list)) { \ >@@ -46,6 +54,11 @@ > } \ > } while (0) > >+/* >+ list_do(list, node) { >+ stuff; >+ } while (!list_done(list, node)); >+ */ > #define list_do(list, curr) \ > if (*list && (curr = *list)) do > >@@ -53,9 +66,29 @@ > (curr && (((curr = (void *)le(curr)->le_next)) && (curr == *list))) > > /* >- list_do(list, node) { >- stuff; >- } while (!list_done(list, node)); >+ * list_for(list, tmp, counter) { >+ * stuff; >+ * } >+ * >+ * counter = # of items in list when done. >+ * * sets cnt to 0 before even checking list; >+ * * checks for valid list >+ * * traverses list, incrementing counter. If we get to the for loop, >+ * there must be at least one item in the list > */ >+#define list_for(list, curr, cnt) \ >+ if (!(cnt=0) && list && *list) \ >+ for (curr = *list; \ >+ (cnt == 0) || (curr != *list); \ >+ curr = (void*)le(curr)->le_next, \ >+ cnt++) >+ >+#define list_for_rev(list, curr, cnt) \ >+ if (!(cnt=0) && list && *list) \ >+ for (curr = (void *)(le(*list)->le_prev); \ >+ (cnt == 0) || ((void *)curr != le(*list)->le_prev); \ >+ curr = (void*)(le(curr)->le_prev), \ >+ cnt++) >+ > > #endif >Index: src/daemons/restree.c >=================================================================== >RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/restree.c,v >retrieving revision 1.10.2.13 >diff -u -r1.10.2.13 restree.c >--- src/daemons/restree.c 3 Nov 2006 16:26:18 -0000 1.10.2.13 >+++ src/daemons/restree.c 8 Mar 2007 22:26:46 -0000 >@@ -953,6 +953,124 @@ > } > > >+static inline int >+_res_op_internal(resource_node_t **tree, resource_t *first, >+ char *type, void *__attribute__((unused))ret, int realop, >+ resource_node_t *node) >+{ >+ int rv, me, op; >+ >+ /* Restore default operation. */ >+ op = realop; >+ >+ /* If we're starting by type, do that funky thing. */ >+ if (type && strlen(type) && >+ strcmp(node->rn_resource->r_rule->rr_type, type)) >+ return 0; >+ >+ /* If the resource is found, all nodes in the subtree must >+ have the operation performed as well. */ >+ me = !first || (node->rn_resource == first); >+ >+ /* >+ printf("begin %s: %s %s [0x%x]\n", res_ops[op], >+ node->rn_resource->r_rule->rr_type, >+ primary_attr_value(node->rn_resource), >+ node->rn_flags); >+ */ >+ >+ if (me) { >+ /* >+ If we've been marked as a node which >+ needs to be started or stopped, clear >+ that flag and start/stop this resource >+ and all resource babies. >+ >+ Otherwise, don't do anything; look for >+ children with RF_NEEDSTART and >+ RF_NEEDSTOP flags. >+ >+ CONDSTART and CONDSTOP are no-ops if >+ the appropriate flag is not set. >+ */ >+ if ((op == RS_CONDSTART) && >+ (node->rn_flags & RF_NEEDSTART)) { >+ /* >+ printf("Node %s:%s - CONDSTART\n", >+ node->rn_resource->r_rule->rr_type, >+ primary_attr_value(node->rn_resource)); >+ */ >+ op = RS_START; >+ } >+ >+ if ((op == RS_CONDSTOP) && >+ (node->rn_flags & RF_NEEDSTOP)) { >+ /* >+ printf("Node %s:%s - CONDSTOP\n", >+ node->rn_resource->r_rule->rr_type, >+ primary_attr_value(node->rn_resource)); >+ */ >+ op = RS_STOP; >+ } >+ } >+ >+ /* Start starts before children */ >+ if (me && (op == RS_START)) { >+ node->rn_flags &= ~RF_NEEDSTART; >+ >+ rv = res_exec(node, op, 0); >+ if (rv != 0) { >+ node->rn_state = RES_FAILED; >+ return rv; >+ } >+ >+ set_time("start", 0, node); >+ clear_checks(node); >+ >+ if (node->rn_state != RES_STARTED) { >+ ++node->rn_resource->r_incarnations; >+ node->rn_state = RES_STARTED; >+ } >+ } else if (me && (op == RS_STATUS)) { >+ /* Check status before children*/ >+ rv = do_status(node); >+ if (rv != 0) >+ return rv; >+ } >+ >+ >+ if (node->rn_child) { >+ rv = _res_op_by_level(&node, me?NULL:first, ret, op); >+ if (rv != 0) >+ return rv; >+ } >+ >+ /* Stop should occur after children have stopped */ >+ if (me && (op == RS_STOP)) { >+ node->rn_flags &= ~RF_NEEDSTOP; >+ rv = res_exec(node, op, 0); >+ >+ if (rv != 0) { >+ node->rn_state = RES_FAILED; >+ return rv; >+ } >+ >+ if (node->rn_state != RES_STOPPED) { >+ --node->rn_resource->r_incarnations; >+ node->rn_state = RES_STOPPED; >+ } >+ } >+ >+ /* >+ printf("end %s: %s %s\n", res_ops[op], >+ node->rn_resource->r_rule->rr_type, >+ primary_attr_value(node->rn_resource)); >+ */ >+ >+ return 0; >+} >+ >+ > /** > Nasty codependent function. Perform an operation by type for all siblings > at some point in the tree. This allows indirectly-dependent resources >@@ -974,120 +1092,24 @@ > _res_op(resource_node_t **tree, resource_t *first, > char *type, void * __attribute__((unused))ret, int realop) > { >- int rv, me; >- resource_node_t *node; >- int op; >- >- list_do(tree, node) { >- >- /* Restore default operation. */ >- op = realop; >- >- /* If we're starting by type, do that funky thing. */ >- if (type && strlen(type) && >- strcmp(node->rn_resource->r_rule->rr_type, type)) >- continue; >- >- /* If the resource is found, all nodes in the subtree must >- have the operation performed as well. */ >- me = !first || (node->rn_resource == first); >- >- /* >- printf("begin %s: %s %s [0x%x]\n", res_ops[op], >- node->rn_resource->r_rule->rr_type, >- primary_attr_value(node->rn_resource), >- node->rn_flags); >- */ >- >- if (me) { >- /* >- If we've been marked as a node which >- needs to be started or stopped, clear >- that flag and start/stop this resource >- and all resource babies. >- >- Otherwise, don't do anything; look for >- children with RF_NEEDSTART and >- RF_NEEDSTOP flags. >- >- CONDSTART and CONDSTOP are no-ops if >- the appropriate flag is not set. >- */ >- if ((op == RS_CONDSTART) && >- (node->rn_flags & RF_NEEDSTART)) { >- /* >- printf("Node %s:%s - CONDSTART\n", >- node->rn_resource->r_rule->rr_type, >- primary_attr_value(node->rn_resource)); >- */ >- op = RS_START; >- } >- >- if ((op == RS_CONDSTOP) && >- (node->rn_flags & RF_NEEDSTOP)) { >- /* >- printf("Node %s:%s - CONDSTOP\n", >- node->rn_resource->r_rule->rr_type, >- primary_attr_value(node->rn_resource)); >- */ >- op = RS_STOP; >- } >- } >- >- /* Start starts before children */ >- if (me && (op == RS_START)) { >- node->rn_flags &= ~RF_NEEDSTART; >- >- rv = res_exec(node, op, 0); >- if (rv != 0) { >- node->rn_state = RES_FAILED; >- return rv; >- } >- >- set_time("start", 0, node); >- clear_checks(node); >- >- if (node->rn_state != RES_STARTED) { >- ++node->rn_resource->r_incarnations; >- node->rn_state = RES_STARTED; >- } >- } >- >- if (node->rn_child) { >- rv = _res_op_by_level(&node, me?NULL:first, ret, op); >- if (rv != 0) >- return rv; >- } >- >- /* Stop/status/etc stops after children have stopped */ >- if (me && (op == RS_STOP)) { >- node->rn_flags &= ~RF_NEEDSTOP; >- rv = res_exec(node, op, 0); >- >- if (rv != 0) { >- node->rn_state = RES_FAILED; >- return rv; >- } >- >- if (node->rn_state != RES_STOPPED) { >- --node->rn_resource->r_incarnations; >- node->rn_state = RES_STOPPED; >- } >- >- } else if (me && (op == RS_STATUS)) { >- >- rv = do_status(node); >- if (rv != 0) >- return rv; >- } >- >- /* >- printf("end %s: %s %s\n", res_ops[op], >- node->rn_resource->r_rule->rr_type, >- primary_attr_value(node->rn_resource)); >- */ >- } while (!list_done(tree, node)); >- >+ resource_node_t *node; >+ int count = 0, rv; >+ >+ if (realop == RS_STOP) { >+ list_for_rev(tree, node, count) { >+ rv = _res_op_internal(tree, first, type, ret, realop, >+ node); >+ if (rv != 0) >+ return rv; >+ } >+ } else { >+ list_for(tree, node, count) { >+ rv = _res_op_internal(tree, first, type, ret, realop, >+ node); >+ if (rv != 0) >+ return rv; >+ } >+ } > return 0; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212121
: 149651 |
150405
|
150702
|
153997