mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
ReadOnly: Check the readonly flag instead of whether the tdb pointer is NULL or not
(This used to be ctdb commit 01314c2cb3a480917d6a632b83c39f0a48bba0e7)
This commit is contained in:
parent
0615ede49d
commit
9729d3e339
@ -507,7 +507,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
||||
}
|
||||
|
||||
/* Dont do READONLY if we dont have a tracking database */
|
||||
if ((c->flags & CTDB_WANT_READONLY) && ctdb_db->rottdb == NULL) {
|
||||
if ((c->flags & CTDB_WANT_READONLY) && !ctdb_db->readonly) {
|
||||
c->flags &= ~CTDB_WANT_READONLY;
|
||||
}
|
||||
|
||||
|
@ -425,7 +425,7 @@ static void daemon_request_call_from_client(struct ctdb_client *client,
|
||||
}
|
||||
|
||||
/* Dont do READONLY if we dont have a tracking database */
|
||||
if ((c->flags & CTDB_WANT_READONLY) && ctdb_db->rottdb == NULL) {
|
||||
if ((c->flags & CTDB_WANT_READONLY) && !ctdb_db->readonly) {
|
||||
c->flags &= ~CTDB_WANT_READONLY;
|
||||
}
|
||||
|
||||
|
@ -937,6 +937,7 @@ again:
|
||||
ropath = talloc_asprintf(ctdb_db, "%s.RO", ctdb_db->db_path);
|
||||
if (ropath == NULL) {
|
||||
DEBUG(DEBUG_CRIT,("Failed to asprintf the tracking database\n"));
|
||||
ctdb_db->readonly = false;
|
||||
talloc_free(ctdb_db);
|
||||
return -1;
|
||||
}
|
||||
@ -946,6 +947,7 @@ again:
|
||||
O_CREAT|O_RDWR, 0);
|
||||
if (ctdb_db->rottdb == NULL) {
|
||||
DEBUG(DEBUG_CRIT,("Failed to open/create the tracking database '%s'\n", ropath));
|
||||
ctdb_db->readonly = false;
|
||||
talloc_free(ctdb_db);
|
||||
return -1;
|
||||
}
|
||||
|
@ -497,6 +497,7 @@ int32_t ctdb_control_push_db(struct ctdb_context *ctdb, TDB_DATA indata)
|
||||
ctdb_db->readonly = false;
|
||||
tdb_close(ctdb_db->rottdb);
|
||||
ctdb_db->rottdb = NULL;
|
||||
ctdb_db->readonly = false;
|
||||
}
|
||||
while (ctdb_db->revokechild_active != NULL) {
|
||||
talloc_free(ctdb_db->revokechild_active);
|
||||
|
Loading…
Reference in New Issue
Block a user