[Sheepdog] [PATCH 8/8] sheep: make recovery requests success in any cases

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sat Aug 28 22:55:34 CEST 2010


I/O operations to recover objects can success always because they are
read operations against the immutable objects (in the past epoch).

This patch makes them success in any cases, and avoid a dead lock
between regular I/O operations and recovery I/O operations.

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

diff --git a/sheep/group.c b/sheep/group.c
index 5763dda..ba8cdfb 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -1401,6 +1401,11 @@ int is_access_to_busy_objects(uint64_t oid)
 		return 0;
 
 	list_for_each_entry(req, &sys->outstanding_req_list, r_wlist) {
+		if (req->rq.flags & SD_FLAG_CMD_RECOVERY) {
+			if (req->rq.opcode != SD_OP_READ_OBJ)
+				eprintf("bug\n");
+			continue;
+		}
 		if (oid == req->local_oid[0] || oid == req->local_oid[1])
 				return 1;
 	}
@@ -1409,6 +1414,12 @@ int is_access_to_busy_objects(uint64_t oid)
 
 static int __is_access_to_busy_objects(struct request *req)
 {
+	if (req->rq.flags & SD_FLAG_CMD_RECOVERY) {
+		if (req->rq.opcode != SD_OP_READ_OBJ)
+			eprintf("bug\n");
+		return 0;
+	}
+
 	if (is_access_to_busy_objects(req->local_oid[0]) ||
 	    is_access_to_busy_objects(req->local_oid[1]))
 		return 1;
-- 
1.5.6.5




More information about the sheepdog mailing list