mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
s3: server_id.pid has turned 64 (bits, that is)
Fix ctdb_processes_exist protocol. The socket expects pid_t which is 32 bits on 32 bit machines. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Nov 10 18:57:01 CET 2011 on sn-devel-104
This commit is contained in:
committed by
Volker Lendecke
parent
5e0258fc93
commit
145f53e824
@ -938,18 +938,25 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
|
|||||||
|
|
||||||
for (i=0; i<num_pids; i++) {
|
for (i=0; i<num_pids; i++) {
|
||||||
struct ctdb_req_control req;
|
struct ctdb_req_control req;
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
results[i] = false;
|
results[i] = false;
|
||||||
reqids[i] = ctdbd_next_reqid(conn);
|
reqids[i] = ctdbd_next_reqid(conn);
|
||||||
|
|
||||||
ZERO_STRUCT(req);
|
ZERO_STRUCT(req);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pids[i].pid is uint64_t, scale down to pid_t which
|
||||||
|
* is the wire protocol towards ctdb.
|
||||||
|
*/
|
||||||
|
pid = pids[i].pid;
|
||||||
|
|
||||||
DEBUG(10, ("Requesting PID %d/%d, reqid=%d\n",
|
DEBUG(10, ("Requesting PID %d/%d, reqid=%d\n",
|
||||||
(int)pids[i].vnn, (int)pids[i].pid,
|
(int)pids[i].vnn, (int)pid,
|
||||||
(int)reqids[i]));
|
(int)reqids[i]));
|
||||||
|
|
||||||
req.hdr.length = offsetof(struct ctdb_req_control, data);
|
req.hdr.length = offsetof(struct ctdb_req_control, data);
|
||||||
req.hdr.length += sizeof(pid_t);
|
req.hdr.length += sizeof(pid);
|
||||||
req.hdr.ctdb_magic = CTDB_MAGIC;
|
req.hdr.ctdb_magic = CTDB_MAGIC;
|
||||||
req.hdr.ctdb_version = CTDB_VERSION;
|
req.hdr.ctdb_version = CTDB_VERSION;
|
||||||
req.hdr.operation = CTDB_REQ_CONTROL;
|
req.hdr.operation = CTDB_REQ_CONTROL;
|
||||||
@ -957,7 +964,7 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
|
|||||||
req.hdr.destnode = pids[i].vnn;
|
req.hdr.destnode = pids[i].vnn;
|
||||||
req.opcode = CTDB_CONTROL_PROCESS_EXISTS;
|
req.opcode = CTDB_CONTROL_PROCESS_EXISTS;
|
||||||
req.srvid = 0;
|
req.srvid = 0;
|
||||||
req.datalen = sizeof(pids[i].pid);
|
req.datalen = sizeof(pid);
|
||||||
req.flags = 0;
|
req.flags = 0;
|
||||||
|
|
||||||
DEBUG(10, ("ctdbd_control: Sending ctdb packet\n"));
|
DEBUG(10, ("ctdbd_control: Sending ctdb packet\n"));
|
||||||
@ -967,7 +974,7 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
|
|||||||
conn->pkt, 2,
|
conn->pkt, 2,
|
||||||
data_blob_const(
|
data_blob_const(
|
||||||
&req, offsetof(struct ctdb_req_control, data)),
|
&req, offsetof(struct ctdb_req_control, data)),
|
||||||
data_blob_const(&pids[i].pid, sizeof(pids[i].pid)));
|
data_blob_const(&pid, sizeof(pid)));
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(10, ("ctdb_packet_send failed: %s\n",
|
DEBUG(10, ("ctdb_packet_send failed: %s\n",
|
||||||
nt_errstr(status)));
|
nt_errstr(status)));
|
||||||
|
Reference in New Issue
Block a user