mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
tdb: allow reads after prepare commit
We previously only allowed a commit to happen after a prepare commit. It is in fact safe to allow reads between a prepare and a commit, and the s4 replication code can make use of that, so allow it.
This commit is contained in:
parent
48bc784e08
commit
f5aec9ebb4
@ -137,14 +137,6 @@ static int transaction_read(struct tdb_context *tdb, tdb_off_t off, void *buf,
|
||||
{
|
||||
uint32_t blk;
|
||||
|
||||
/* Only a commit is allowed on a prepared transaction */
|
||||
if (tdb->transaction->prepared) {
|
||||
tdb->ecode = TDB_ERR_EINVAL;
|
||||
TDB_LOG((tdb, TDB_DEBUG_FATAL, "transaction_read: transaction already prepared, read not allowed\n"));
|
||||
tdb->transaction->transaction_error = 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* break it down into block sized ops */
|
||||
while (len + (off % tdb->transaction->block_size) > tdb->transaction->block_size) {
|
||||
tdb_len_t len2 = tdb->transaction->block_size - (off % tdb->transaction->block_size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user