summaryrefslogtreecommitdiff
path: root/source3/lib
AgeCommit message (Collapse)AuthorFilesLines
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
2010-01-23s3: Remove string_sid_tallocVolker Lendecke1-13/+0
All but one call were pointless, so I think this API should go
2010-01-23s3: Remove some pointless uses of string_sid_tallocVolker Lendecke1-1/+1
2010-01-23s3: Fix some nonempty blank linesVolker Lendecke1-11/+11
2010-01-21s3: Move "yesno" to the only place where it is used: client.cVolker Lendecke1-18/+0
2010-01-17s3: For "smbcontrol <pid> pool-usage", print the first 50 bytes of a stringVolker Lendecke1-0/+17
2010-01-17s3: Fix some nonempty blank linesVolker Lendecke1-5/+5
2010-01-14s3:smbldap: add smbldap_talloc_first_attribute()Stefan Metzmacher1-0/+34
metze Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit c992127f8a96c37940a6d298c7c6859c47f83d9b)
2010-01-10s3: Remove unused samr_make_sam_obj_sdVolker Lendecke1-40/+0
2010-01-08s3-time: fix build warnings after we moved to shared time functions.Günther Deschner1-6/+6
Bjoern, please check. Guenther
2010-01-07s3:lib/time: remove TIME_T_MIN/MAX definesBjörn Jacke1-8/+0
we already get them from lib/util/time.h
2010-01-07ѕ3:lib/time: replace make_dos_ and put_dos_ functions with those from lib/util/Björn Jacke1-89/+6
2010-01-07s3:lib/time: remoce null_mtime() - use null_time()Björn Jacke1-13/+2
2010-01-07s3:lib/time: remove unused nt_time_equalsBjörn Jacke1-8/+0
we have nt_time_equal doing the same in lib/util/
2010-01-02s3: Adapt sid_dup_talloc to README.CodingVolker Lendecke1-8/+9
2009-12-10s3: add LDAP Alias Dereferencing supportBjörn Jacke1-0/+11
Thanks to Dan Cox for initial patch for 3.0. This closes #2350.
2009-12-10s3-ldb: use GUID_to_ndr_blob()Andrew Tridgell1-2/+1
this also fixes an error in NTSTATUS handling
2009-12-08s3: make sys_posix_fallocate more genericBjörn Jacke1-4/+4
this is in preparation for other preallocation methods to be introduced.
2009-12-07s3: let gencache_init() use tdb_check()Stefan Metzmacher1-0/+25
If the check fails we try to clear the tdb and start with an empty cache. metze
2009-12-07s3: let tdb_validate_child() use tdb_check()Stefan Metzmacher1-0/+11
metze
2009-12-05s3:dbwrap_ctdb: increase the number of commit retries 5-->100Michael Adam1-1/+1
This is to cope with timeouts when recoveries and transactions collide. Maybe 100 is too hight, but 10 or even 20 have been too low in a very busy environment. Michael
2009-12-05s3:dbwrap_ctdb: increase the rsn of the __transaction_lock__ when storingMichael Adam1-0/+2
so that it is correctly handled by recoveries. Also set the dmaster explicitly. Michael
2009-12-05s3: Fix explicit stat64 supportVolker Lendecke1-3/+12
2009-12-04s3: check if glibc has broken posix_fallocateBjörn Jacke1-1/+1
2009-12-02Restructure the ACL code some more, get the internal semanticsJeremy Allison1-0/+20
right. The previous bugs were due to the fact that get_nt_acl_internal() could return an NTSTATUS error if there was no stored ACL blob, but otherwise would return the underlying ACL from the filysystem. Fix this so it always returns a valid acl if it can, and if it does not its an error to be reported back to the client. This then changes the inherit acl code. Previously we were trying to match Windows by setting a minimal ACL on a new file that didn't inherit anything from a parent directory. This is silly - the returned ACL wouldn't match the underlying UNIX permissions. The current code will correctly inherit from a parent if a parent has any inheritable ACE entries that apply to the new object, but will return a mapping from the underlying UNIX permissions if the parent has no inheritable entries. This makes much more sense for new files/directories. Jeremy.
2009-12-02s3: prefer posix_fallocate for doing "strict allocate"Björn Jacke1-0/+14
posix_fallocate is more efficient than manual zero'ing the file. When preallocation in kernel space is supported it's extremely fast. Support for preallocation at fs layer via posix_fallocate and fallocate at kernel site can be found in Linux kernel 2.6.23/glibc 2.10 with ext4, XFS and OCFS2. Other systems that I know of which support fast preallocation in kernel space are AIX 6.1 with JFS2 and recent Solaris versions with ZFS maybe UFS2, too. People who have a system with preallocation in kernel space might want to set "strict allocate = yes". This reduces file fragentation and it's also safer for setups with quota being turned on. As of today most systems still don't have preallocation in kernel space, and that's why "strict allocate = no" will stay the default for now.
2009-12-02s3: Cope with older external libtdbVolker Lendecke1-0/+2