summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_call.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2011-10-28 11:44:19 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2011-10-28 11:44:19 +1100
commit19bd9149c35e8c2e08e2cc19be195e6cfda6c7f3 (patch)
tree45952137e5abe129f9bfe0a07fa5b48d838ef8ff /ctdb/server/ctdb_call.c
parentf7db49798c810f948b68e54cb070abf9d0518910 (diff)
downloadsamba-19bd9149c35e8c2e08e2cc19be195e6cfda6c7f3.tar.gz
samba-19bd9149c35e8c2e08e2cc19be195e6cfda6c7f3.tar.xz
samba-19bd9149c35e8c2e08e2cc19be195e6cfda6c7f3.zip
ReadOnly: fix bug writing incorrect amount of data in delegated record
Fix bug when ctdbd updates the local copy of a delegated record to write the correct amount of data to the record. (This used to be ctdb commit 8814d8bc159a5e368afaa236ac7d865165db04b2)
Diffstat (limited to 'ctdb/server/ctdb_call.c')
-rw-r--r--ctdb/server/ctdb_call.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c
index 9fc8b33901..23d10b9210 100644
--- a/ctdb/server/ctdb_call.c
+++ b/ctdb/server/ctdb_call.c
@@ -741,8 +741,14 @@ void ctdb_reply_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
goto finished_ro;
}
+ if (c->datalen < sizeof(struct ctdb_ltdb_header)) {
+ DEBUG(DEBUG_ERR,(__location__ " Got FETCH_WITH_HEADER reply with too little data: %d bytes\n", c->datalen));
+ ctdb_ltdb_unlock(ctdb_db, key);
+ goto finished_ro;
+ }
+
+ data.dsize = c->datalen - sizeof(struct ctdb_ltdb_header);
data.dptr = &c->data[sizeof(struct ctdb_ltdb_header)];
- data.dsize = sizeof(struct ctdb_ltdb_header);
ret = ctdb_ltdb_store(ctdb_db, key, header, data);
if (ret != 0) {
DEBUG(DEBUG_ERR, ("Failed to store new record in ctdb_reply_call\n"));