mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
ctdb: pass TDB_DISALLOW_NESTING to all tdb_open/tdb_wrap_open calls
metze Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 1635e931b909c66eb3b1f5357e3a549b1a0da70d)
This commit is contained in:
parent
2d24073e97
commit
003985acfd
@ -1686,6 +1686,7 @@ struct ctdb_db_context *ctdb_attach(struct ctdb_context *ctdb, const char *name,
|
||||
if (!ctdb->do_setsched) {
|
||||
tdb_flags |= TDB_NOMMAP;
|
||||
}
|
||||
tdb_flags |= TDB_DISALLOW_NESTING;
|
||||
|
||||
ctdb_db->ltdb = tdb_wrap_open(ctdb, ctdb_db->db_path, 0, tdb_flags, O_RDWR, 0);
|
||||
if (ctdb_db->ltdb == NULL) {
|
||||
|
@ -251,6 +251,7 @@ static int ctdb_local_attach(struct ctdb_context *ctdb, const char *db_name, boo
|
||||
if (!ctdb->do_setsched) {
|
||||
tdb_flags |= TDB_NOMMAP;
|
||||
}
|
||||
tdb_flags |= TDB_DISALLOW_NESTING;
|
||||
|
||||
ctdb_db->ltdb = tdb_wrap_open(ctdb, ctdb_db->db_path,
|
||||
ctdb->tunable.database_hash_size,
|
||||
|
@ -1020,6 +1020,7 @@ static struct tdb_wrap *create_recdb(struct ctdb_context *ctdb, TALLOC_CTX *mem_
|
||||
if (!ctdb->do_setsched) {
|
||||
tdb_flags |= TDB_NOMMAP;
|
||||
}
|
||||
tdb_flags |= TDB_DISALLOW_NESTING;
|
||||
|
||||
recdb = tdb_wrap_open(mem_ctx, name, ctdb->tunable.database_hash_size,
|
||||
tdb_flags, O_RDWR|O_CREAT|O_EXCL, 0600);
|
||||
|
@ -435,7 +435,9 @@ static int ctdb_repack_tdb(struct tdb_context *tdb, TALLOC_CTX *mem_ctx, struct
|
||||
return -1;
|
||||
}
|
||||
|
||||
tmp_db = tdb_open("tmpdb", tdb_hash_size(tdb), TDB_INTERNAL, O_RDWR|O_CREAT, 0);
|
||||
tmp_db = tdb_open("tmpdb", tdb_hash_size(tdb),
|
||||
TDB_INTERNAL|TDB_DISALLOW_NESTING,
|
||||
O_RDWR|O_CREAT, 0);
|
||||
if (tmp_db == NULL) {
|
||||
DEBUG(DEBUG_ERR,(__location__ " Failed to create tmp_db\n"));
|
||||
tdb_transaction_cancel(tdb);
|
||||
@ -524,7 +526,9 @@ static int update_tuning_db(struct ctdb_db_context *ctdb_db, struct vacuum_data
|
||||
return -1;
|
||||
}
|
||||
|
||||
tune_tdb = tdb_open(vac_dbname, 0, 0, O_RDWR|O_CREAT, 0644);
|
||||
tune_tdb = tdb_open(vac_dbname, 0,
|
||||
TDB_DISALLOW_NESTING,
|
||||
O_RDWR|O_CREAT, 0644);
|
||||
if (tune_tdb == NULL) {
|
||||
DEBUG(DEBUG_ERR,(__location__ " Failed to create/open %s\n", TUNINGDBNAME));
|
||||
talloc_free(tmp_ctx);
|
||||
@ -685,7 +689,9 @@ static int get_vacuum_interval(struct ctdb_db_context *ctdb_db)
|
||||
return interval;
|
||||
}
|
||||
|
||||
tdb = tdb_open(vac_dbname, 0, 0, O_RDWR|O_CREAT, 0644);
|
||||
tdb = tdb_open(vac_dbname, 0,
|
||||
TDB_DISALLOW_NESTING,
|
||||
O_RDWR|O_CREAT, 0644);
|
||||
if (!tdb) {
|
||||
DEBUG(DEBUG_ERR,("Unable to open/create database %s using default interval\n", vac_dbname));
|
||||
talloc_free(tmp_ctx);
|
||||
|
@ -507,7 +507,9 @@ static int ctdb_repack_tdb(struct tdb_context *tdb)
|
||||
return -1;
|
||||
}
|
||||
|
||||
tmp_db = tdb_open("tmpdb", tdb_hash_size(tdb), TDB_INTERNAL, O_RDWR|O_CREAT, 0);
|
||||
tmp_db = tdb_open("tmpdb", tdb_hash_size(tdb),
|
||||
TDB_INTERNAL|TDB_DISALLOW_NESTING,
|
||||
O_RDWR|O_CREAT, 0);
|
||||
if (tmp_db == NULL) {
|
||||
DEBUG(DEBUG_ERR,(__location__ " Failed to create tmp_db\n"));
|
||||
tdb_transaction_cancel(tdb);
|
||||
|
Loading…
Reference in New Issue
Block a user