[sheepdog] [PATCH UPDATE] sheep: fix a bug of objects loss when some node has zone set to 0
levin li
levin108 at gmail.com
Sat Aug 4 13:38:54 CEST 2012
From: levin li <xingke.lwp at taobao.com>
Before the patch 5b27736abffc3fe569b4ec5335806ad345e279b9 it's OK
to set zone to 0, because we skip the same node in get_nth_page(),
but after that patch, we just check same_zone() in get_nth_page(),
and same_zone() return false when zone of some node is 0, so there's
problem, it's reasonable for users to set zone to 0, so this patch
fixes this problem
Signed-off-by: levin li <xingke.lwp at taobao.com>
---
include/sheep.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/sheep.h b/include/sheep.h
index 5795111..ef8dc22 100644
--- a/include/sheep.h
+++ b/include/sheep.h
@@ -57,7 +57,7 @@ static inline int same_node(struct sd_vnode *e, int n1, int n2)
static inline int same_zone(struct sd_vnode *e, int n1, int n2)
{
- return e[n1].zone != 0 && e[n1].zone == e[n2].zone;
+ return e[n1].zone == e[n2].zone;
}
/* traverse the virtual node list and return the n'th one */
--
1.7.10
More information about the sheepdog
mailing list