diff options
author | Michael Adam <obnox@samba.org> | 2012-06-29 10:39:07 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-06-29 15:21:17 +0200 |
commit | 9d11277337113bad885240f2fc53c692c1be99bf (patch) | |
tree | bdd9023095ebba42fa38d47599cd03dce6e8042c | |
parent | 19941a90548de20ca0deda0b7b16135e7989b77f (diff) | |
download | samba-9d11277337113bad885240f2fc53c692c1be99bf.tar.gz samba-9d11277337113bad885240f2fc53c692c1be99bf.tar.bz2 samba-9d11277337113bad885240f2fc53c692c1be99bf.zip |
s3:dbwrap_ctdb: fix fetch/fetch_locked when samba is built against old ctdb
The introduction of read only copies has broken the algorithm for
deteting whether we can use the local record copy for fetch_locked
and fetch: For fetch locked the new code always uses the local copy
if there is one...
This patch re-establish the original algorithm for the build against
a ctdb without read only record copies.
Reported-by: Gregor Beck <gbeck@sernet.de>
-rw-r--r-- | source3/lib/dbwrap/dbwrap_ctdb.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c index 1062cb0bbd..01dfacac1a 100644 --- a/source3/lib/dbwrap/dbwrap_ctdb.c +++ b/source3/lib/dbwrap/dbwrap_ctdb.c @@ -1006,9 +1006,7 @@ static int db_ctdb_record_destr(struct db_record* data) /* Do I own this record? */ static bool db_ctdb_own_record(TDB_DATA ctdb_data, bool read_only) { -#ifdef HAVE_CTDB_WANT_READONLY_DECL struct ctdb_ltdb_header *hdr; -#endif if (ctdb_data.dptr == NULL) return false; @@ -1016,8 +1014,9 @@ static bool db_ctdb_own_record(TDB_DATA ctdb_data, bool read_only) if (ctdb_data.dsize < sizeof(struct ctdb_ltdb_header)) return false; -#ifdef HAVE_CTDB_WANT_READONLY_DECL hdr = (struct ctdb_ltdb_header *)ctdb_data.dptr; + +#ifdef HAVE_CTDB_WANT_READONLY_DECL if (hdr->dmaster != get_my_vnn()) { /* If we're not dmaster, it must be r/o copy. */ return read_only && (hdr->flags & CTDB_REC_RO_HAVE_READONLY); @@ -1026,7 +1025,7 @@ static bool db_ctdb_own_record(TDB_DATA ctdb_data, bool read_only) /* If we want write access, noone can have r/o copies. */ return read_only || !(hdr->flags & CTDB_REC_RO_HAVE_DELEGATIONS); #else - return !read_only; + return (hdr->dmaster == get_my_vnn()); #endif } |