[Sheepdog] [PATCH 3/5] sheep: fix consistency recovery

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Jan 27 13:47:40 CET 2011


The content of hdr could be overwritten after sending a read request,
so we need to set its fields again.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/store.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/sheep/store.c b/sheep/store.c
index 858e534..4b685f2 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -751,6 +751,7 @@ static int fix_object_consistency(struct request *req, int idx)
 	struct sd_obj_req req_bak = *((struct sd_obj_req *)&req->rq);
 	struct sd_obj_rsp rsp_bak = *((struct sd_obj_rsp *)&req->rp);
 	void *data = req->data, *buf;
+	uint64_t oid = hdr->oid;
 
 	if (is_data_obj(hdr->oid))
 		data_length = SD_DATA_OBJ_SIZE;
@@ -776,6 +777,7 @@ static int fix_object_consistency(struct request *req, int idx)
 
 	hdr->opcode = SD_OP_WRITE_OBJ;
 	hdr->flags = SD_FLAG_CMD_WRITE;
+	hdr->oid = oid;
 	ret = forward_write_obj_req(req, idx);
 	if (ret < 0) {
 		eprintf("failed to write object, %d\n", ret);
-- 
1.5.6.5




More information about the sheepdog mailing list