[SCM] Samba Shared Repository - branch v3-2-test updated -
release-3-2-0pre2-334-g4cc09ec
Volker Lendecke
vlendec at samba.org
Thu Mar 20 15:59:02 GMT 2008
The branch, v3-2-test has been updated
via 4cc09ec40609484c973361a0cc0f05bfaef1738e (commit)
via ddc989886deff173b8a2a2a753a896770efe7545 (commit)
via df574fd2ee58f008b93b06f4d78c85cb909cc92c (commit)
from 7dc64d1021e0b8f3339f811c8c144f7013a649a8 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 4cc09ec40609484c973361a0cc0f05bfaef1738e
Author: Volker Lendecke <vl at samba.org>
Date: Thu Mar 20 16:15:38 2008 +0100
Fix an uninitialized variable warning
commit ddc989886deff173b8a2a2a753a896770efe7545
Author: root <root at gpfs1.sernet.private>
Date: Thu Mar 20 15:59:37 2008 +0100
Port 3c1f1f0797e from 3-0-ctdb
We need to inform ctdb about the client's TCP connection so that after a fail
over ctdbd can trigger the client to reconnect very quickly
commit df574fd2ee58f008b93b06f4d78c85cb909cc92c
Author: Volker Lendecke <vl at samba.org>
Date: Thu Mar 20 12:49:13 2008 +0100
Fix some warnings in the tsmsm module
Alexander, please check!
-----------------------------------------------------------------------
Summary of changes:
source/modules/vfs_tsmsm.c | 10 ++++--
source/rpc_server/srv_srvsvc_nt.c | 1 +
source/smbd/server.c | 60 +++++++++++++++++++++++++++++++++++--
3 files changed, 64 insertions(+), 7 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/modules/vfs_tsmsm.c b/source/modules/vfs_tsmsm.c
index 791e8cf..aa0f945 100644
--- a/source/modules/vfs_tsmsm.c
+++ b/source/modules/vfs_tsmsm.c
@@ -148,8 +148,9 @@ static bool tsmsm_is_offline(struct vfs_handle_struct *handle,
/* if the file has more than FILE_IS_ONLINE_RATIO of blocks available,
then assume it is not offline (it may not be 100%, as it could be sparse) */
if (512 * (off_t)stbuf->st_blocks >= stbuf->st_size * tsmd->online_ratio) {
- DEBUG(10,("%s not offline: st_blocks=%ld st_size=%ld online_ratio=%.2f\n",
- path, stbuf->st_blocks, stbuf->st_size, tsmd->online_ratio));
+ DEBUG(10,("%s not offline: st_blocks=%ld st_size=%ld "
+ "online_ratio=%.2f\n", path, (long)stbuf->st_blocks,
+ (long)stbuf->st_size, tsmd->online_ratio));
return false;
}
@@ -226,8 +227,9 @@ static bool tsmsm_aio_force(struct vfs_handle_struct *handle, struct files_struc
if the file might be offline
*/
if(SMB_VFS_FSTAT(fsp, &sbuf) == 0) {
- DEBUG(10,("tsmsm_aio_force st_blocks=%ld st_size=%ld online_ratio=%.2f\n",
- sbuf.st_blocks, sbuf.st_size, tsmd->online_ratio));
+ DEBUG(10,("tsmsm_aio_force st_blocks=%ld st_size=%ld "
+ "online_ratio=%.2f\n", (long)sbuf.st_blocks,
+ (long)sbuf.st_size, tsmd->online_ratio));
return !(512 * (off_t)sbuf.st_blocks >= sbuf.st_size * tsmd->online_ratio);
}
return false;
diff --git a/source/rpc_server/srv_srvsvc_nt.c b/source/rpc_server/srv_srvsvc_nt.c
index 053f57e..15c7d71 100644
--- a/source/rpc_server/srv_srvsvc_nt.c
+++ b/source/rpc_server/srv_srvsvc_nt.c
@@ -1075,6 +1075,7 @@ WERROR _srvsvc_NetFileEnum(pipes_struct *p,
ctx = talloc_tos();
ctr3 = r->in.info_ctr->ctr.ctr3;
if (!ctr3) {
+ werr = WERR_INVALID_PARAM;
goto done;
}
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 50c84f9..179d480 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -59,6 +59,23 @@ int get_client_fd(void)
return server_fd;
}
+int client_get_tcp_info(struct sockaddr_in *server, struct sockaddr_in *client)
+{
+ socklen_t length;
+ if (server_fd == -1) {
+ return -1;
+ }
+ length = sizeof(*server);
+ if (getsockname(server_fd, (struct sockaddr *)server, &length) != 0) {
+ return -1;
+ }
+ length = sizeof(*client);
+ if (getpeername(server_fd, (struct sockaddr *)client, &length) != 0) {
+ return -1;
+ }
+ return 0;
+}
+
struct event_context *smbd_event_context(void)
{
static struct event_context *ctx;
@@ -946,10 +963,8 @@ void exit_server_fault(void)
/****************************************************************************
received when we should release a specific IP
****************************************************************************/
-static void msg_release_ip(struct messaging_context *msg_ctx, void *private_data,
- uint32_t msg_type, struct server_id server_id, DATA_BLOB *data)
+static void release_ip(const char *ip, void *priv)
{
- const char *ip = (const char *)data->data;
char addr[INET6_ADDRSTRLEN];
if (strcmp(client_socket_addr(get_client_fd(),addr,sizeof(addr)), ip) == 0) {
@@ -964,6 +979,11 @@ static void msg_release_ip(struct messaging_context *msg_ctx, void *private_data
}
}
+static void msg_release_ip(struct messaging_context *msg_ctx, void *private_data,
+ uint32_t msg_type, struct server_id server_id, DATA_BLOB *data)
+{
+ release_ip((char *)data->data, NULL);
+}
/****************************************************************************
Initialise connect, service and file structs.
@@ -1378,6 +1398,40 @@ extern void build_options(bool screen);
exit(1);
}
+#ifdef CLUSTER_SUPPORT
+
+ if (lp_clustering()) {
+ /*
+ * We need to tell ctdb about our client's TCP
+ * connection, so that for failover ctdbd can send
+ * tickle acks, triggering a reconnection by the
+ * client.
+ */
+
+ struct sockaddr_in srv, clnt;
+
+ if (client_get_tcp_info(&srv, &clnt) == 0) {
+
+ NTSTATUS status;
+
+ status = ctdbd_register_ips(
+ messaging_ctdbd_connection(),
+ &srv, &clnt, release_ip, NULL);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("ctdbd_register_ips failed: %s\n",
+ nt_errstr(status)));
+ }
+ } else
+ {
+ DEBUG(0,("Unable to get tcp info for "
+ "CTDB_CONTROL_TCP_CLIENT: %s\n",
+ strerror(errno)));
+ }
+ }
+
+#endif
+
TALLOC_FREE(frame);
smbd_process();
--
Samba Shared Repository
More information about the samba-cvs
mailing list