]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
merge from ronnie
authorAndrew Tridgell <tridge@samba.org>
Thu, 26 Apr 2007 09:13:49 +0000 (11:13 +0200)
committerAndrew Tridgell <tridge@samba.org>
Thu, 26 Apr 2007 09:13:49 +0000 (11:13 +0200)
(This used to be ctdb commit 37ef65737571a4290a150c28cf2b0a6b221253fd)

1  2 
ctdb/common/ctdb_call.c
ctdb/include/ctdb_private.h

index 40bfa1660d1720f7a502116ceb56e741123a9b05,99a27fbf80c28df64e1057da4602bede0b6e6877..86da20ea2e83e3f2a51daf00b0f45991f2720a3c
@@@ -601,15 -629,20 +629,23 @@@ void ctdb_reply_redirect(struct ctdb_co
        struct ctdb_reply_redirect *c = (struct ctdb_reply_redirect *)hdr;
        struct ctdb_call_state *state;
  
-       state = idr_find_type(ctdb->idr, hdr->reqid, struct ctdb_call_state);
-       if (state == NULL) return;
+       state = ctdb_reqid_find(ctdb, hdr->reqid, struct ctdb_call_state);
+       if (state == NULL) {
+               return;
+       }
+       if (hdr->reqid != state->reqid) {
+               /* we found a record  but it was the wrong one */
+               DEBUG(0, ("Dropped orphaned dmaster reply with reqid:%d\n",hdr->reqid));
+               return;
+       }
  
        /* don't allow for too many redirects */
 -      if (state->redirect_count++ == CTDB_MAX_REDIRECT) {
 +      if ((++state->redirect_count) % CTDB_MAX_REDIRECT == 0) {
                c->dmaster = ctdb_lmaster(ctdb, &state->call.key);
 +              if (state->redirect_count > ctdb->status.max_redirect_count) {
 +                      ctdb->status.max_redirect_count = state->redirect_count;
 +              }
        }
  
        /* send it off again */
Simple merge