[sheepdog] [PATCH 2/5] object cache: fix object creation failure

Liu Yuan namei.unix at gmail.com
Tue Jun 19 05:55:15 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

When the flush request come right after create request, currently we'll
push nothing back because we don't mark the object dirty at all. We really
should do this because we actually want to push back the whole object for
creation in backend.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/object_cache.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index ff83821..99d2bb8 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -309,7 +309,9 @@ static int object_cache_lookup(struct object_cache *oc, uint32_t idx,
 		if (ret != SD_RES_SUCCESS)
 			ret = -1;
 		else {
-			entry = alloc_cache_entry(idx, 0, 1);
+			uint64_t bmap = UINT64_MAX;
+
+			entry = alloc_cache_entry(idx, bmap, 1);
 			pthread_mutex_lock(&oc->lock);
 			add_to_dirty_tree_and_list(oc, entry);
 			pthread_mutex_unlock(&oc->lock);
-- 
1.7.10.2




More information about the sheepdog mailing list