summaryrefslogtreecommitdiff
path: root/source3/lib
AgeCommit message (Collapse)AuthorFilesLines
2010-02-25s3-nltest: fix uninitialized query level.Günther Deschner1-1/+1
Guenther
2010-02-24s3: Make connections_fetch_record() staticVolker Lendecke1-2/+2
2010-02-23s3: Consolidate server_id_self into the equivalent procid_self()Volker Lendecke1-5/+0
2010-02-23s3-lib: Remove obsolete signal type cast.Andreas Schneider3-12/+12
2010-02-20s3: Make string_to_sid survive the LOCAL-string_to_sid testVolker Lendecke1-13/+40
2010-02-18s3: optimize strict allocate for XFS on IRIXBjörn Jacke1-0/+25
2010-02-16s3: Fix timeout calculation if g_lock_lock is given a timeout < 60sVolker Lendecke1-1/+6
Detected while showing this code to obnox :-)
2010-02-16s3: Slightly increase parallelism in g_lockVolker Lendecke1-1/+7
There's no need to still hold the g_lock tdb-level lock while telling the waiters to retry
2010-02-16s3: Avoid starving locks when many processes die at the same timeVolker Lendecke1-6/+4
In g_lock_unlock we have a little race between the process_exists and messaging_send call: We only send to 5 waiters now, they all might have died between us checking their existence and sending the message. This change makes g_lock_lock retry at least once every minute.
2010-02-16s3: Avoid a thundering herd in g_lock_unlockVolker Lendecke1-1/+16
Only notify the first 5 pending lock waiters. This avoids a thundering herd problem that is really nasty in a cluster. It also makes acquiring a lock a bit more FIFO, lock waiters are added to the end of the array.
2010-02-16s3: Optimize g_lock_lock for a heavily contended caseVolker Lendecke1-3/+36
Only check the existence of the lock owner in g_lock_parse, check the rest of the records only when we got the lock successfully. This reduces the load on process_exists which can involve a network roundtrip in the clustered case.
2010-02-16s3: Fix handling of processes that died in g_lockVolker Lendecke1-3/+5
g_lock_parse might have thrown away entries from the locks array because the processes were not around anymore. Don't store the orphaned entries.
2010-02-15s3: Fix a typoVolker Lendecke1-1/+1
2010-02-14s3: Fix initgroups return checkPeter Watkins1-1/+1
A return code of 1 from initgroups() is OK since apparently it means the gid has already been set. The man page doesn't mention this.
2010-02-14s3-lib: use TYPESAFE_QSORT() in s3 interfaces codeAndrew Tridgell1-1/+1
2010-02-13s3: Remove unused comparison fn from "struct sorted_tree"Volker Lendecke1-8/+2
2010-02-13s3: Make adt_tree data definitions private to adt_tree.cVolker Lendecke1-0/+14
2010-02-13s3: SORTED_TREE -> struct sorted_treeVolker Lendecke1-6/+8
2010-02-13s3: TREE_NODE -> struct tree_nodeVolker Lendecke1-12/+18
2010-02-13s3: Fix some nonempty blank linesVolker Lendecke1-69/+68
2010-02-12Use sec_initial_uid() in the places where being root doesn't matter,Jeremy Allison3-3/+3
and 0 in the places where it does. Jeremy
2010-02-12Fix warning messages on compile in g_lock.c Volker & Michael please check.Jeremy Allison1-14/+4
Jeremy.
2010-02-12s3:g_lock: remove a nested event loop, replacing the inner loop by selectMichael Adam1-38/+101
This made smbd crash in g_lock_lock() when trying to start a transaction on a db with an already started transaction, e.g. in a tcon_and_X where the share_info.tdb was not yet initialized but share_info.tdb was already locked by another process or writing acces to the winreg rpc pipe where the registry tdb was already locked by another process. What we really _want_ to do here by design is to react to MSG_DBWRAP_G_LOCK_RETRY messages that are either sent by a client doing g_lock_unlock or by ourselves when we receive a CTDB_SRVID_SAMBA_NOTIFY or CTDB_SRVID_RECONFIGURE message from ctdbd, i.e. when either a client holding a lock or a complete node has died. Doing this properly involves calling tevent_loop_once(), but doing this here with the main ctdbd messaging context creates a nested event loop when g_lock_lock() is called from the main event loop. So as a quick fix, we act a little corasely here: we do a select on the ctdb connection fd and when it is readable or we get EINTR, then we retry without actually parsing any ctdb packages or dispatching messages. This means that we retry more often than necessary and intended by design, but this does not harm and it is unobtrusive. When we have finished, the main loop will pick up all the messages and ctdb packets. The only extra twist is that we cannot use timed events here but have to handcode a timeout for select. Michael
2010-02-12s3:ctdb_conn: add ctdbd_conn_get_fd() to get the fd out of the ctdb connectionMichael Adam1-0/+5
Michael
2010-02-12s3:g_lock: remove an unreached code path.Michael Adam1-4/+0
Michael
2010-02-12s3:dbwrap_ctdb: fix reading/storing of special key __db_sequence_number__Michael Adam1-4/+2
The key for reading and writing was inconsistent due to a off by one data length. Michael
2010-02-12s3:dbwrap_ctdb: exit early when nothing has been written in transaction_commit.Michael Adam1-5/+9
This skips update of the __db_sequence_number__ record when nothing else has been written. There are transactions that are just openend and then nothing is written until transaction_commit is called. This is for instance the case with registry initialization routines: They start a transaction and only write somthing when the registry has not been initialized yet. So this change will skip many db_seqnum bumps and TRANS3_COMMIT roundtrips. Michael
2010-02-12s3:dbwrap_ctdb: fix brown paperbag bug in ctdb_transaction_commit.Michael Adam1-1/+1
I carefully prepared the return value only to "return 0;" at the bottom. :-( This may well have hit us for instance in the nested cancel case and produced random errors. Michael
2010-02-12s3:dbwrap_ctdb: fix logic error in pull_newest_from_marshall_buffer().Michael Adam1-1/+5
The logic bug was that if a record was found in the marshall buffer, then always the ctdb header of tha last record in the marshall buffer was returned, and not the ctdb header of the last occurrence of the requested record. This is fixed by introducing an additional temporary variable. Michael
2010-02-12s3:dbwrap_ctdb: fix an uninitialized variable.Michael Adam1-1/+1
Michael
2010-02-12s3:dbwrap_ctdb: fix two "may be used uninitialized" warningsMichael Adam1-0/+3
Michael
2010-02-12s3:dbwrap_ctdb: fix db_ctdb_fetch_db_seqnum_from_db() when NT_STATUS_NOT_FOUND.Michael Adam1-1/+5
Don't treat this as an error but return seqnum 0 instead. Michael
2010-02-12s3:dbwrap_ctdb: maintain a database sequence number that bumps in transactionsMichael Adam1-5/+116
For persistent databases, 64bit integer is kept in a special record __db_sequence_number__. This record is incremented with each completed transaction. The retry mechanism for failing TRANS3_COMMIT controls inside the db_ctdb_transaction_commit() function now relies one a modified behaviour of ctdbd's treatment of persistent databases in recoveries. Recently, a special treatment for persistent databases had been introduced in ctdb (1.0.108) to work around the problems with the orinal design of persistent transactions. Now with the rewrite we need to revert to the old behaviour that ctdb always takes the newest copies of all records. This change also paves the way for a next step, which will make recovery use the db seqnum to tell which node has the newest copy of a persistent db and use that node's copy. This will greatly reduce the amount of data transferred with each recovery. Michael
2010-02-12s3:dbwrap_ctdb: change db_ctdb_transaction_store() to return NTSTATUS.Michael Adam1-18/+12
The return values calculated by the callers were wrong anyways since the new marshalling code does not set the local tdbs tdb error code. Michael
2010-02-12s3:dbwrap_ctdb: update (C)Michael Adam1-1/+2
Michael
2010-02-12s3:dbwrap_ctdb: start rewrite of transactions using the global lock (g_lock)Michael Adam1-320/+160
This simplifies the transaction code a lot: * transaction_start essentially consists of acquiring a global lock. * No write operations at all are performed on the local database until the transaction is committed: Every store operation is just going into the marshall buffer. * The commit operation calls a new simplified TRANS3_COMMIT control in ctdb which rolls out thae changes to all nodes including the node that is performing the transaction. Michael
2010-02-12s3: Add ctdb_conn_msg_ctx()Volker Lendecke1-0/+5
2010-02-12s3: Implement global locks in a g_lock tdbVolker Lendecke2-5/+662
This is the basis to implement global locks in ctdb without depending on a shared file system. The initial goal is to make ctdb persistent transactions deterministic without too many timeouts.
2010-02-10util: rewrite dlinklist.h so that DLIST_ADD_END() is O(1)Andrew Tridgell1-59/+111
This changes the meaning of the ->prev pointer in our doubly linked lists to point at the end of the list from the front of the list. That allows us to implement DLIST_ADD_END() and related functions in O(1) time, which can be a huge saving in many places in Samba. This also means that the 'type' argument to various DLIST_*() macros is no longer needed, but I have left it in for now to keep the patchset small, which will make it easier to revert if any problems are found. In the future we should remove the 'type' arguments. (jra. Move the one use of DLIST_TAIL over to the new macros).
2010-02-10s3-memcache: update memcache to use new DLIST macrosAndrew Tridgell1-18/+3
we don't need a separate lru pointer any more (cherry picked from commit 4ffd7aca3e38728077bd80c2a65c4efbcfd216fc)
2010-02-10s3-ldb: update the old ldb in s3 to use new DLIST macrosAndrew Tridgell2-30/+4
(cherry picked from commit a7d8bfd373392eecf4fff33d39b85e1b55ad901d)
2010-02-10Temporary changes to dlinklist to keep the implementation static whilstJeremy Allison1-0/+16
uses of (list)->prev are moved over to DLIST_PREV. This will be replaced when the final (new) version of the dlinklist.h header is added. Jeremy.
2010-02-05s3-events: make the old timed events compatible with teventAndrew Tridgell1-2/+19
tevent ensures that a timed event is only called once. The old events code relied on the called handler removing the event itself. If the handler removed the event after calling a function which invoked the event loop then the timed event could loop forever. This change makes the two timed event systems more compatible, by allowing the handler to free the te if it wants to, but ensuring it is off the linked list of events before the handler is called, and ensuring it is freed even if the handler doesn't free it.
2010-02-05s3-brlock: we don't need these MSG_SMB_UNLOCK calls nowAndrew Tridgell1-8/+0
These have been replaced with the min timeout in blocking.c
2010-01-26Fix bug #7067 - Linux asynchronous IO (aio) can cause smbd to fail to ↵Jeremy Allison1-4/+61
respond to a read or write. Only works on Linux kernels 2.6.26 and above. Grants CAP_KILL capability to allow Linux threads under different euids to send signals to each other. Jeremy.
2010-01-26s3:netapi: remove unused variableBjörn Jacke1-2/+0
2010-01-25Revert "s3: Make string_to_sid a wrapper around dom_sid_parse"Volker Lendecke1-7/+50
This reverts commit dff03b61fd5d923562711b38cc7dbe996dc07283.
2010-01-24s3: add libnetapi_set_use_ccache()Volker Lendecke3-0/+16
2010-01-24s3: Add -C (--use-ccache) to popt_common_credentialsVolker Lendecke2-1/+16
2010-01-23s3: Make string_to_sid a wrapper around dom_sid_parseVolker Lendecke1-50/+7