[sheepdog] [PATCH] object cache: don't panic in object_cache_read/wrie()

Liu Yuan namei.unix at gmail.com
Mon Jul 30 03:37:56 CEST 2012


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

The caller of object_cache_read/write() can handle the 'NO_CACHE' case
gracefully.

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

diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index 1f3e631..00876c1 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -1087,7 +1087,7 @@ int object_cache_write(uint64_t oid, char *data, unsigned int datalen,
 
 	entry = get_cache_entry(cache, idx);
 	if (!entry) {
-		panic("cache object %" PRIx32 " doesn't exist\n", idx);
+		dprintf("cache object %" PRIx32 " doesn't exist\n", idx);
 		return SD_RES_NO_CACHE;
 	}
 
@@ -1115,7 +1115,7 @@ int object_cache_read(uint64_t oid, char *data, unsigned int datalen,
 
 	entry = get_cache_entry(cache, idx);
 	if (!entry) {
-		panic("cache object %" PRIx32 " doesn't exist\n", idx);
+		dprintf("cache object %" PRIx32 " doesn't exist\n", idx);
 		return SD_RES_NO_CACHE;
 	}
 
-- 
1.7.10.2




More information about the sheepdog mailing list