1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-12 04:23:49 +03:00
Commit Graph

107 Commits

Author SHA1 Message Date
Michael Adam
7b2cabea55 r24738: Fix one more use of pwrite in tdb code in the spirit of r23972 and r23977.
Michael
2007-10-10 15:03:01 -05:00
Jelmer Vernooij
48d1aa4fcf r24337: Make libreplace provide offsetof. 2007-10-10 15:01:39 -05:00
Jelmer Vernooij
f90a698387 r24336: Use standard data type uint32_t rather than tdb-specific u32. 2007-10-10 15:01:39 -05:00
Michael Adam
b97acdc67b r23980: Fix one more use of pwrite in expand_file.
Michael
2007-10-10 15:01:15 -05:00
Michael Adam
eb524df0a5 r23979: Fix another occurence of (written != requested) as an
error condition to write. This is in tdb_new_database.

Fix one call to tdb_new_database in tdb_open_ex to not
overwrite the newly propagated errno (typically ENOSPC).

Michael
2007-10-10 15:01:14 -05:00
Michael Adam
868cdb1781 r23978: Merge r23161 from Samba3:
Add TDB_VOLATILE as open_flag to activate the per-hashchain dead record
optimization.
2007-10-10 15:01:14 -05:00
Michael Adam
7f415d1223 r23977: Im prove the pwrite-patch to tdb_expand_file of r23972:
* prevent infinite loops due to 0 bytes written:
  try once more. if we still get 0 as return,
  set errno to ENOSPC and return -1 (error)

* replace int by correct types (ssize_t and size_t).

* print a warning log message in case "written < requested to write"
  usually this means, that the next call to pwrite will fail
  with return value -1 and set errno accordingly.

  Note that the former error condition "written != requested to write"
  is not a correct error condition of write/pwrite. If this is due
  to an error, a subsequent call to (p)write will reveal the cause
  (typically "no space left on device" - ENOSPC).

Michael
2007-10-10 15:01:13 -05:00
Michael Adam
4c3c6363f8 r23972: Fix a bug in pwrite error detection in tdb_expand_file():
The proper error condition is (ret == -1) instead of
(ret != number_of_byte_told_to_write).

Michael
2007-10-10 15:01:13 -05:00
Andrew Tridgell
40c0919aaa r23798: updated old Temple Place FSF addresses to new URL 2007-10-10 14:59:15 -05:00
Andrew Tridgell
84b468b2f8 r23795: more v2->v3 conversion 2007-10-10 14:59:14 -05:00
Jeremy Allison
59ba128cb6 r23590: Fix realloc leak on failure case from Jim Meyering <jim@meyering.net>.
Jeremy.
2007-10-10 14:53:28 -05:00
Jeremy Allison
fa880e6cc1 r23371: Fix the misleading comment I added - it really *should*
say "locks chain and returned record", not
"and returns record"
Jeremy.
2007-10-10 14:53:13 -05:00
Jeremy Allison
fa548ad75e r23370: Traverse in tdb wasn't consistently using the
travlocks.lock_rw for lock read/write types, it
was sometimes using it (tdb_next_lock) and
sometimes explicitly using F_WRLCK instead.
Change this to consistently use travlocks.lock_rw
only.
I'm pretty sure about this fix (else I woudn't
be checking this in :-) but tridge and Volker
please review.
Jeremy.
2007-10-10 14:53:12 -05:00
Andrew Tridgell
9dbb2633d7 r23238: merged transaction lock changes from ctdb
this ensures that having the global lock also implies the transaction
lock
2007-10-10 14:53:06 -05:00
Andrew Tridgell
a88ab4fa3a r22832: merged the latest tdb changes from ctdb to Samba4 2007-10-10 14:52:22 -05:00
Andrew Tridgell
bffb8f8800 r22424: fixed the bad merge (thanks to metze for pointing out) 2007-10-10 14:51:18 -05:00
Andrew Tridgell
a0ff739bca r22422: merged tdb changes from ctdb 2007-10-10 14:51:17 -05:00
Stefan Metzmacher
8f24f6b38e r22319: sync lib/tdb/ with samba3
metze
2007-10-10 14:51:01 -05:00
Andrew Tridgell
ff78be0be4 r22165: merge transaction fix from samba3 2007-10-10 14:49:56 -05:00
Andrew Tridgell
6921f2f709 r22081: transaction_brlock() should be static
thanks to Ted T'so for pointing this out
2007-10-10 14:49:48 -05:00
Stefan Metzmacher
902a76ca70 r22041: merge trivial changes from samba3
metze
2007-10-10 14:49:45 -05:00
Volker Lendecke
98a27ab28a r21722: Add the dead record functionality presented on samba-technical@samba.org. If
you do a tdb_set_max_dead(tdb, n), then for this tdb a delete operation will
only mark a record as dead and re-use it if a new record is created. The
parameter n allows for at most n dead records per hash chain. If this number
is exceeded, all dead records are put on the central freelist.

Volker
2007-10-10 14:49:18 -05:00
Volker Lendecke
afe7d78558 r21445: Apply tdb_parse_record Tridges error return, merge to 3_0_25 and 4_0 2007-10-10 14:48:36 -05:00
Volker Lendecke
ed30a0ff60 r21412: The last patch also incremented the seqnum when tdb_store failed. Not as bad
as not doing it at all, but needs fixing. Also simplify the logic, I had
missed the "goto out" at the end of the function.

Volker
2007-10-10 14:48:28 -05:00
Volker Lendecke
e518c68fc5 r21410: We have to increment the sequence number also when tdb_update_hash()
succeeded. Found while testing the brlock seqnum patch.

Tridge, please check!

Volker
2007-10-10 14:48:27 -05:00
Volker Lendecke
7b5db2e472 r21303: As discussed on samba-technical: Change the static array for the in-memory
mirrors of the hash chain locks to a dynamically allocated one.

Jeremy, I count on you to revert it if the build farm freaks out, it's after
midnight here :-)

Volker
2007-10-10 14:48:06 -05:00
Jeremy Allison
bd0710fa09 r19960: Add code to check for loops in the free list.
Should help us validate tdb's against corruption.
Jeremy.
2007-10-10 14:28:40 -05:00
Andrew Tridgell
979dd24f5e r19428: moved tdbutil.c from lib/tdb/common/ to lib/util/util_tdb.c
tdbutil.c is Samba specific, so should not be part of the generic tdb
library
2007-10-10 14:21:30 -05:00
Andrew Tridgell
c9d9d79c34 r19425: two more tdb functions from samba3 2007-10-10 14:21:29 -05:00
Andrew Tridgell
db3211079f r19423: merge some tdb changes from SAMBA_3_0 to SAMBA_4_0
this is in preparation of a merge in the other direction
2007-10-10 14:21:29 -05:00
Andrew Tridgell
de664ec1f8 r19401: make tdb_lockall() much more efficient, and add a tdb_lockall_read()
call which does a read lock on all chains. These will be used to make
ldb searches more efficient
2007-10-10 14:21:26 -05:00
Andrew Tridgell
025b142ff2 r18400: move MAP_FAILED define to lib/replace/system/shmem.h 2007-10-10 14:18:23 -05:00
Andrew Tridgell
eba6c84eff r18301: I discovered how to load the warnings from a build farm build into
emacs compile mode (hint, paste to a file, and compile as "cat
filename").

This allowed me to fix nearly all the warnings for a IA_64 SuSE build
very quickly.
2007-10-10 14:18:04 -05:00
Andrew Tridgell
57cd0ca176 r18160: - pread and pwrite replacements need to be non-static
- replacing rename() is pointless - all platforms have it (and the
  #define of rename breaks some code)

- use system/locale.h in snprintf.c

- fix passwd.h for initgroups

- stdlib is in replace.h, not needed elsewhere

- fix the initgroups replacement

- fix mapping of dl functions to rep_*
2007-10-10 14:17:44 -05:00
Andrew Tridgell
77d1a468e0 r18129: moved the system includes into libreplace - this gives much more
isolation of our portability environment from the main code, and also
simplifies the includes system (no separate #ifdef _SAMBA_BUILD for
tdb. ldb etc now)
2007-10-10 14:17:36 -05:00
Jelmer Vernooij
f7afa1cb77 r17930: Merge noinclude branch:
* Move dlinklist.h, smb.h to subsystem-specific directories
 * Clean up ads.h and move what is left of it to dsdb/
   (only place where it's used)
2007-10-10 14:16:54 -05:00
Stefan Metzmacher
af08e56442 r17532: merge from SAMBA_3_0 Revision: 17460
First step at fixing the build breakage with the groupmapping test. On Linux,
 F_RDLCK is defined to 0, for example NetBSD has it at 1.

 Still does not work fully though. Still investigating.

metze
2007-10-10 14:15:34 -05:00
Simo Sorce
941f680453 r17507: pread and pwrite depends on HAVE_PREAD/HAVE_PWRITE not HAVE_PREAD_DECL/HAVE_PWRITE_DECL
and common/io.h already defines pread and pwrite as static if they are not.

remove unneded defines
2007-10-10 14:15:30 -05:00
Andrew Bartlett
5d5503e8d8 r16916: Implement metze's proposed changes to the tdb logging API.
This clearly links the log function with its private pointer, and
makes the argument list for tdb_open_ex a bit shorter.

Andrew Bartlett
2007-10-10 14:09:59 -05:00
Stefan Metzmacher
249bf24a40 r16776: fix typo
metze
2007-10-10 14:09:45 -05:00
Andrew Bartlett
58898092c1 r16774: This patch modifies the tdb API to allow the logging function to be used
as part of ldb.

This allows tdb failures to be passed all the way up to Samba's DEBUG
system, which allowed easier debugging.

Unfortunately I had to extend the tdb API, as the logging function
didn't have a context pointer.

I've worked over the 'debug levels' in TDB.  Most of them were 0,
which didn't seem right, as some were trace-like messages.  We didn't
see any of these previously, except when accessing TDB directly.

Andrew Bartlett
2007-10-10 14:09:45 -05:00
Simo Sorce
2898df2cee r16043: Fix error message 2007-10-10 14:08:52 -05:00
Volker Lendecke
0476715671 r15120: Minimize the diff between Samba3 and Samba4 tdb: In Samba3 we don't allow C++
keywords. Change "private" -> "private_data".

Volker
2007-10-10 14:04:10 -05:00
Volker Lendecke
5f1d52f232 r15100: Port the bugfix for #3569 to Samba4 2007-10-10 14:04:09 -05:00
Andrew Tridgell
9b867d2acf r14972: fix an uninitialised warning from ibm checker 2007-10-10 14:00:48 -05:00
Andrew Tridgell
4c3f3c4141 r14916: print errno so I can work out why OpenBSD is failing the test for tdb
in the build farm. msync() is failing.
2007-10-10 14:00:16 -05:00
Andrew Tridgell
f325ba605c r14799: added a tdb_get_seqnum() call, and the TDB_SEQNUM flag. This allows
for an extremely lightweight test to see if a tdb has possibly
changed.
2007-10-10 13:59:20 -05:00
Jeremy Allison
d2e9d5b34b r14029: Fix resource leak in error codepath. Coverity CID #64.
Jeremy.
2007-10-10 13:52:37 -05:00
Simo Sorce
1113d4caa7 r13773: Be consistent in the way you get out and free allocated data 2007-10-10 13:52:11 -05:00
Andrew Tridgell
a37d9434d1 r13283: added two optimisations to the tdb transactions code. The first is to
more agressively coalesce entries in the linked list of the undo
log. The second is to ensure that writes during a transaction into the
hash table don't cause the size of the undo log linked list to grow.

These optimisations don't affect Samba much, but they make a huge
difference to the use of ldb in kde
2007-10-10 13:51:42 -05:00