diff options
author | Volker Lendecke <vl@samba.org> | 2012-07-16 16:18:19 +0200 |
---|---|---|
committer | Christian Ambach <ambi@samba.org> | 2012-08-03 12:53:49 +0200 |
commit | 6cfe6e92a1f962040a22f107086b19159bb7c605 (patch) | |
tree | df108dce2675ff1bf830cddb7bf86eef8e06f42e | |
parent | 6d83e35410eb852b36678277085726992dc32f98 (diff) | |
download | samba-6cfe6e92a1f962040a22f107086b19159bb7c605.tar.gz samba-6cfe6e92a1f962040a22f107086b19159bb7c605.tar.bz2 samba-6cfe6e92a1f962040a22f107086b19159bb7c605.zip |
s3-ctdb: Fix ctdb_serverids_exist for target nodes that died
Signed-off-by: Christian Ambach <ambi@samba.org>
-rw-r--r-- | source3/lib/ctdbd_conn.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index dddb41285e..0fa2f9040c 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -1190,6 +1190,7 @@ bool ctdb_serverids_exist(struct ctdbd_connection *conn, struct ctdb_reply_control *reply = NULL; struct ctdb_vnn_list *vnn; uint32_t reqid; + uint8_t *reply_data; status = ctdb_read_req(conn, 0, talloc_tos(), (void *)&reply); if (!NT_STATUS_IS_OK(status)) { @@ -1227,13 +1228,26 @@ bool ctdb_serverids_exist(struct ctdbd_connection *conn, (unsigned)vnn->vnn, vnn->num_srvids, (unsigned)reply->datalen)); - if (reply->datalen < ((vnn->num_srvids+7)/8)) { - DEBUG(1, ("Received short reply len %d, status %u," + if (reply->datalen >= ((vnn->num_srvids+7)/8)) { + /* + * Got a real reply + */ + reply_data = reply->data; + } else { + /* + * Got an error reply + */ + DEBUG(1, ("Received short reply len %d, status %u, " "errorlen %u\n", (unsigned)reply->datalen, (unsigned)reply->status, (unsigned)reply->errorlen)); - goto fail; + dump_data(1, reply->data, reply->errorlen); + + /* + * This will trigger everything set to false + */ + reply_data = NULL; } for (i=0; i<vnn->num_srvids; i++) { @@ -1244,7 +1258,9 @@ bool ctdb_serverids_exist(struct ctdbd_connection *conn, results[idx] = true; continue; } - results[idx] = ((reply->data[i/8] & (1<<(i%8))) != 0); + results[idx] = + (reply_data != NULL) && + ((reply_data[i/8] & (1<<(i%8))) != 0); } TALLOC_FREE(reply); |