Ignore:
Timestamp:
Apr 9, 2010, 3:51:41 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.5.x: trunk update to 3.5.2

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/lib/ctdbd_conn.c

    r414 r429  
    362362                }
    363363
    364                 if (msg->srvid == CTDB_SRVID_RECONFIGURE) {
    365                         DEBUG(0,("Got cluster reconfigure message in ctdb_read_req\n"));
     364                if ((msg->srvid == CTDB_SRVID_RECONFIGURE)
     365                    || (msg->srvid == CTDB_SRVID_SAMBA_NOTIFY)) {
     366
     367                        DEBUG(1, ("ctdb_read_req: Got %s message\n",
     368                                  (msg->srvid == CTDB_SRVID_RECONFIGURE)
     369                                  ? "cluster reconfigure" : "SAMBA_NOTIFY"));
     370
    366371                        messaging_send(conn->msg_ctx, procid_self(),
    367372                                       MSG_SMB_BRL_VALIDATE, &data_blob_null);
     373                        messaging_send(conn->msg_ctx, procid_self(),
     374                                       MSG_DBWRAP_G_LOCK_RETRY,
     375                                       &data_blob_null);
    368376                        TALLOC_FREE(hdr);
    369377                        goto next_pkt;
     
    494502        }
    495503
     504        status = register_with_ctdbd(conn, CTDB_SRVID_SAMBA_NOTIFY);
     505        if (!NT_STATUS_IS_OK(status)) {
     506                goto fail;
     507        }
     508
    496509        *pconn = conn;
    497510        return NT_STATUS_OK;
     
    500513        TALLOC_FREE(conn);
    501514        return status;
     515}
     516
     517struct messaging_context *ctdb_conn_msg_ctx(struct ctdbd_connection *conn)
     518{
     519        return conn->msg_ctx;
     520}
     521
     522int ctdbd_conn_get_fd(struct ctdbd_connection *conn)
     523{
     524        return packet_get_fd(conn->pkt);
    502525}
    503526
     
    534557        SMB_ASSERT(conn->msg_ctx != NULL);
    535558
    536         if (msg->srvid == CTDB_SRVID_RECONFIGURE) {
     559        if ((msg->srvid == CTDB_SRVID_RECONFIGURE)
     560            || (msg->srvid == CTDB_SRVID_SAMBA_NOTIFY)){
    537561                DEBUG(0,("Got cluster reconfigure message\n"));
    538562                /*
    539                  * when the cluster is reconfigured, we need to clean the brl
    540                  * database
     563                 * when the cluster is reconfigured or someone of the
     564                 * family has passed away (SAMBA_NOTIFY), we need to
     565                 * clean the brl database
    541566                 */
    542567                messaging_send(conn->msg_ctx, procid_self(),
    543568                               MSG_SMB_BRL_VALIDATE, &data_blob_null);
    544569
    545                 /*
    546                  * it's possible that we have just rejoined the cluster after
    547                  * an outage. In that case our pending locks could have been
    548                  * removed from the lockdb, so retry them once more
    549                  */
    550                 message_send_all(conn->msg_ctx, MSG_SMB_UNLOCK, NULL, 0, NULL);
     570                messaging_send(conn->msg_ctx, procid_self(),
     571                               MSG_DBWRAP_G_LOCK_RETRY,
     572                               &data_blob_null);
    551573
    552574                TALLOC_FREE(buf);
    553 
    554575                return NT_STATUS_OK;
    555576        }
     
    13111332}
    13121333
     1334NTSTATUS ctdb_watch_us(struct ctdbd_connection *conn)
     1335{
     1336        struct ctdb_client_notify_register reg_data;
     1337        size_t struct_len;
     1338        NTSTATUS status;
     1339        int cstatus;
     1340
     1341        reg_data.srvid = CTDB_SRVID_SAMBA_NOTIFY;
     1342        reg_data.len = 1;
     1343        reg_data.notify_data[0] = 0;
     1344
     1345        struct_len = offsetof(struct ctdb_client_notify_register,
     1346                              notify_data) + reg_data.len;
     1347
     1348        status = ctdbd_control_local(
     1349                conn, CTDB_CONTROL_REGISTER_NOTIFY, conn->rand_srvid, 0,
     1350                make_tdb_data((uint8_t *)&reg_data, struct_len),
     1351                NULL, NULL, &cstatus);
     1352        if (!NT_STATUS_IS_OK(status)) {
     1353                DEBUG(1, ("ctdbd_control_local failed: %s\n",
     1354                          nt_errstr(status)));
     1355        }
     1356        return status;
     1357}
     1358
     1359NTSTATUS ctdb_unwatch(struct ctdbd_connection *conn)
     1360{
     1361        struct ctdb_client_notify_deregister dereg_data;
     1362        NTSTATUS status;
     1363        int cstatus;
     1364
     1365        dereg_data.srvid = CTDB_SRVID_SAMBA_NOTIFY;
     1366
     1367        status = ctdbd_control_local(
     1368                conn, CTDB_CONTROL_DEREGISTER_NOTIFY, conn->rand_srvid, 0,
     1369                make_tdb_data((uint8_t *)&dereg_data, sizeof(dereg_data)),
     1370                NULL, NULL, &cstatus);
     1371        if (!NT_STATUS_IS_OK(status)) {
     1372                DEBUG(1, ("ctdbd_control_local failed: %s\n",
     1373                          nt_errstr(status)));
     1374        }
     1375        return status;
     1376}
     1377
    13131378#else
    13141379
Note: See TracChangeset for help on using the changeset viewer.