1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-05 12:22:11 +03:00
Commit Graph

42 Commits

Author SHA1 Message Date
1a416ff13c Convert in_transaction to a bool. Add the same fix Volker
used for tdb_traverse() to tdb_traverse_read().
Jeremy.
(This used to be commit bda0f03fb3)
2008-05-20 14:18:58 -07:00
6ed27edbcd Fix nesting tdb_traverse in a transaction
Calling tdb_traverse inside a transaction led to the transaction lock being
held indefinitely. This was caused by the tdb_transaction_lock/unlock inside
tdb_traverse: The transaction code holds the global lock at offset
TRANSACTION_LOCK. The call to tdb_transaction_lock does nothing because the
transaction_lock is already being held. tdb_transaction_unlock inside tdb_wrap
resets tdb->have_transaction_lock but does not release the kernel-level fcntl
lock. transaction_commit later on does not release that fcntl lock either,
because tdb->have_transaction_lock was already reset by tdb_transaction().

This patch does fix that problem for me. An alternative would be to make
tdb->have_transaction_lock a counter that can cope with proper nesting, maybe
in other places as well.

Volker
(This used to be commit 80e700e3bd)
2008-05-20 21:59:44 +02:00
e41ca7ef1b merge tdb changes from ctdb
(This used to be commit 92503eb60e)
2008-02-08 14:16:51 +11:00
e3b4db8807 merge growing tdb for tdb_wipe_all() fix from ctdb
(This used to be commit eaba373747)
2008-02-07 23:08:11 +11:00
6b5980e47e merged tdb transaction fix
(This used to be commit 1a1c795436)
2008-01-31 09:48:20 +11:00
313a21b4d9 merged changes from v4-0-test
(This used to be commit 8c89d60924)
2008-01-18 15:46:15 +11:00
5b37e815b4 Don't try ftruncate when the tdb is opened read-only
Tridge, Jeremy, please check!

Thanks,

Volker
(This used to be commit e4f46d5274)
2008-01-16 21:18:26 +01:00
7084854bd9 Next try to fix the max dead record calculation
(This used to be commit 4f95c58040)
2008-01-16 21:04:52 +01:00
c308d76305 Fix some C++ warnings
(This used to be commit 625241c477)
2008-01-16 20:29:41 +01:00
b0950557f9 Fix a missing prototype warning
(This used to be commit 871cee04f2)
2008-01-16 20:25:57 +01:00
7e2b8eb079 Port from ctdb:
minor fix to transaction_write_existing: tridge.

Jeremy.
(This used to be commit 874425c8f6)
2008-01-15 17:20:50 -08:00
63b1c765de samba3 already has tdb_validate()
(This used to be commit 9f002eeff9)
2008-01-14 16:26:52 +11:00
a1902700c4 merged tdb fix from ctdb tree
(This used to be commit c91e9c785b)
2008-01-14 15:38:43 +11:00
5b6520044b Fix the max_dead_record calculations
(This used to be commit 4aaf4e7e73)
2008-01-13 22:58:41 +01:00
2ec41571a3 Sync tdb with the tdb changes in ctdb. Spoke to tridge about
this. Fixes insidious problem with order n^2 freelist merging.
Jeremy.
(This used to be commit c6609c042b)
2008-01-11 15:08:37 -08:00
66d6eb27a4 Fix the max_dead_record calculations
(This used to be commit 2a5c53220a)
2008-01-09 23:24:30 +01:00
a605be7314 Add a warning for a potential bug I've run into
(This used to be commit 223352e323)
2007-11-28 09:45:40 -08:00
afc3eee3b8 Add a missing prototype
(This used to be commit 89e2984a84)
2007-11-22 16:00:13 +01:00
99fd77f4ae Fix const warning.
Jeremy.
(This used to be commit ecc2555197)
2007-11-06 23:09:31 -08:00
3809490dd0 Keep the tdb code in sync with Samba4.
Mainly this is the svn changes :

------------------------------------------------------------------------
r23238 | tridge | 2007-05-30 01:15:49 -0700 (Wed, 30 May 2007) | 6 lines

merged transaction lock changes from ctdb

this ensures that having the global lock also implies the transaction
lock

------------------------------------------------------------------------
r22832 | tridge | 2007-05-13 18:00:06 -0700 (Sun, 13 May 2007) | 3 lines

merged the latest tdb changes from ctdb to Samba4

Jeremy.
(This used to be commit ab11c00557)
2007-11-06 22:57:35 -08:00
d8f3c9d078 Fix bug where tdb lock call interrupted with
an alarm sig would not terminate and could lead
to runaway smbd processes.
Thanks to Dave Daugherty @ Centrify for pointing
this out to us.
Jeremy.
(This used to be commit ef8da16983)
2007-11-06 21:47:57 -08:00
9d29664b33 offsetof() is always present as shown in some
libreplace testing.

metze
(This used to be commit 4f084efd6a)
2007-10-12 10:06:27 +02:00
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
068d95cde1 r24743: Fix build warning.
Guenther
(This used to be commit 579fb55b75)
2007-10-10 12:30:17 -05:00
c7489a5d96 r24738: Fix one more use of pwrite in tdb code in the spirit of r23972 and r23977.
Michael
(This used to be commit a3506f291a)
2007-10-10 12:30:16 -05:00
db2666759d r24341: Make libreplace provide offsetof.
(This used to be commit 4a5fa715a6)
2007-10-10 12:29:31 -05:00
594bbfcdee r24340: Use standard data type uint32_t rather than tdb-specific u32.
(This used to be commit 26d1430283)
2007-10-10 12:29:30 -05:00
115062e7ce r24049: Some more 64-bit warnings
(This used to be commit eabe796e46)
2007-10-10 12:28:59 -05:00
84f352caa5 r23980: Fix one more use of pwrite in expand_file.
Michael
(This used to be commit de0ef91346)
2007-10-10 12:28:52 -05:00
207a213c06 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
(This used to be commit 24fed55d72)
2007-10-10 12:28:51 -05:00
e5051dd4a6 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
(This used to be commit 5b8d53dfe1)
2007-10-10 12:28:51 -05:00
146c0781f3 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
(This used to be commit e3af95f098)
2007-10-10 12:28:50 -05:00
9fa1c63578 r23798: updated old Temple Place FSF addresses to new URL
(This used to be commit c676a97114)
2007-10-10 12:28:26 -05:00
2c09988e46 r23790: LGPLv3+ conversion for our LGPLv2+ library code
(This used to be commit 1b78cace50)
2007-10-10 12:28:25 -05:00
ed961d66b2 r23590: Fix realloc leak on failure case from Jim Meyering <jim@meyering.net>.
Jeremy.
(This used to be commit d7b39e4534)
2007-10-10 12:23:33 -05:00
5b11268609 r23371: Fix the misleading comment I added - it really *should*
say "locks chain and returned record", not
"and returns record"
Jeremy.
(This used to be commit bf951e3d7f)
2007-10-10 12:23:11 -05:00
68f2b1d9f6 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.
(This used to be commit d0b6456763)
2007-10-10 12:23:10 -05:00
d5daef32b2 r23161: Add TDB_VOLATILE as open_flag to activate the per-hashchain dead record
optimization.
(This used to be commit 945f73fa39)
2007-10-10 12:22:50 -05:00
123e721590 r22317: add tdb_ prefix to non static function
metze
(This used to be commit 56e31d60c6)
2007-10-10 12:19:26 -05:00
6f9f5bd745 r22316: merge from samba4:
this function should be static

metze
(This used to be commit f722fd32da)
2007-10-10 12:19:26 -05:00
97079ab953 r22315: move tdbback.c content into tdbbackup.c
and make the functions static.

also use libreplace headers in tdbbackup.c

metze
(This used to be commit 1ca12b1c9e)
2007-10-10 12:19:26 -05:00
4a245a1580 r22249: move tdb code to lib/tdb/ as in samba4
metze
(This used to be commit c7def92a9c)
2007-10-10 12:19:22 -05:00