[sheepdog] [PATCH] object cache: correct bypass_object_cache
Liu Yuan
namei.unix at gmail.com
Tue Jun 25 05:39:10 CEST 2013
We should check object type as early as possible
This fix 'cluster snapshot' failure with cache enabled.
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
sheep/object_cache.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index 8126b40..aec3a6b 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -1068,6 +1068,11 @@ bool bypass_object_cache(const struct request *req)
if (!sys->enable_object_cache || req->local)
return true;
+ /* For vmstate && vdi_attr object, we don't do caching */
+ if (is_vmstate_obj(oid) || is_vdi_attr_obj(oid) ||
+ req->rq.flags & SD_FLAG_CMD_COW)
+ return true;
+
if (req->rq.flags & SD_FLAG_CMD_DIRECT) {
uint32_t vid = oid_to_vid(oid);
struct object_cache *cache;
@@ -1089,10 +1094,6 @@ bool bypass_object_cache(const struct request *req)
}
}
- /* For vmstate && vdi_attr object, we don't do caching */
- if (is_vmstate_obj(oid) || is_vdi_attr_obj(oid) ||
- req->rq.flags & SD_FLAG_CMD_COW)
- return true;
return false;
}
--
1.7.9.5
More information about the sheepdog
mailing list