[sheepdog] [PATCH] sheep: fix is_erasure_req()

Liu Yuan namei.unix at gmail.com
Thu Oct 10 06:46:33 CEST 2013


For inode object, it is not erasure coded, we should test it first.

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/gateway.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sheep/gateway.c b/sheep/gateway.c
index 68e5203..1660f0b 100644
--- a/sheep/gateway.c
+++ b/sheep/gateway.c
@@ -173,9 +173,15 @@ out:
 /* Requests from dog might not have vdi registered yet in the vdi state */
 static bool is_erasure_req(struct request *req)
 {
+	uint64_t oid = req->rq.obj.oid;
+
+	if (is_vdi_obj(oid))
+		return false;
+
 	if (req->rq.obj.copy_policy > 0)
 		return true;
-	return is_erasure_oid(req->rq.obj.oid);
+
+	return get_vdi_copy_policy(oid_to_vid(oid)) > 0;
 }
 
 bool is_erasure_oid(uint64_t oid)
-- 
1.7.9.5




More information about the sheepdog mailing list