~ubuntu-branches/ubuntu/vivid/ctdb/vivid-proposed

« back to all changes in this revision

Viewing changes to .pc/05-hurd.diff/server/ctdb_daemon.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2011-11-06 15:18:59 UTC
  • mfrom: (1.2.14)
  • Revision ID: package-import@ubuntu.com-20111106151859-41lblk8ml4es7ra3
Tags: 1.11+git20111102-1
* New upstream release
  - removed 92-apache-service-enable.diff: integrated 
  - removed 99-fix-broken-readdir-test.diff: integrated
* d/rules, d/control, d/compat:
  - converted to dh (% target and dh_auto_*)
  - moved to compat level 9 (buildeps upgraded)
  - dh9 enabled hardening build flags
  - added hardening=+bindnow
  - dh9 enabled multiarch
    + Don't use /use/lib64 on ppc64 (Closes: #644907)
    + libctdb-dev is Multi-Arch: same
    + removed 10_no-lib64.diff: not needed with multiarch
* ctdb.init:
  - removed gettext support
  - synced with upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
312
312
        }
313
313
        r->hdr.reqid        = dstate->reqid;
314
314
        r->datalen          = dstate->call->reply_data.dsize;
 
315
        r->status           = dstate->call->status;
315
316
        memcpy(&r->data[0], dstate->call->reply_data.dptr, r->datalen);
316
317
 
317
318
        res = daemon_queue_send(client, &r->hdr);
423
424
                return;
424
425
        }
425
426
 
 
427
        /* Dont do READONLY if we dont have a tracking database */
 
428
        if ((c->flags & CTDB_WANT_READONLY) && !ctdb_db->readonly) {
 
429
                c->flags &= ~CTDB_WANT_READONLY;
 
430
        }
 
431
 
 
432
        if (header.flags & CTDB_REC_RO_REVOKE_COMPLETE) {
 
433
                header.flags &= ~(CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE);
 
434
                if (ctdb_ltdb_store(ctdb_db, key, &header, data) != 0) {
 
435
                        ctdb_fatal(ctdb, "Failed to write header with cleared REVOKE flag");
 
436
                }
 
437
                /* and clear out the tracking data */
 
438
                if (tdb_delete(ctdb_db->rottdb, key) != 0) {
 
439
                        DEBUG(DEBUG_ERR,(__location__ " Failed to clear out trackingdb record\n"));
 
440
                }
 
441
        }
 
442
 
 
443
        /* if we are revoking, we must defer all other calls until the revoke
 
444
         * had completed.
 
445
         */
 
446
        if (header.flags & CTDB_REC_RO_REVOKING_READONLY) {
 
447
                talloc_free(data.dptr);
 
448
                ret = ctdb_ltdb_unlock(ctdb_db, key);
 
449
 
 
450
                if (ctdb_add_revoke_deferred_call(ctdb, ctdb_db, key, (struct ctdb_req_header *)c, daemon_incoming_packet, client) != 0) {
 
451
                        ctdb_fatal(ctdb, "Failed to add deferred call for revoke child");
 
452
                }
 
453
                return;
 
454
        }
 
455
 
 
456
        if ((header.dmaster == ctdb->pnn)
 
457
        && (!(c->flags & CTDB_WANT_READONLY))
 
458
        && (header.flags & (CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY)) ) {
 
459
                header.flags   |= CTDB_REC_RO_REVOKING_READONLY;
 
460
                if (ctdb_ltdb_store(ctdb_db, key, &header, data) != 0) {
 
461
                        ctdb_fatal(ctdb, "Failed to store record with HAVE_DELEGATIONS set");
 
462
                }
 
463
                ret = ctdb_ltdb_unlock(ctdb_db, key);
 
464
 
 
465
                if (ctdb_start_revoke_ro_record(ctdb, ctdb_db, key, &header, data) != 0) {
 
466
                        ctdb_fatal(ctdb, "Failed to start record revoke");
 
467
                }
 
468
                talloc_free(data.dptr);
 
469
 
 
470
                if (ctdb_add_revoke_deferred_call(ctdb, ctdb_db, key, (struct ctdb_req_header *)c, daemon_incoming_packet, client) != 0) {
 
471
                        ctdb_fatal(ctdb, "Failed to add deferred call for revoke child");
 
472
                }
 
473
 
 
474
                return;
 
475
        }               
 
476
 
426
477
        dstate = talloc(client, struct daemon_call_state);
427
478
        if (dstate == NULL) {
428
479
                ret = ctdb_ltdb_unlock(ctdb_db, key);