[Sheepdog] [PATCH 1/3] sheep: fix get_nr_copies()

Liu Yuan namei.unix at gmail.com
Mon Apr 30 10:53:45 CEST 2012


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

We should never return anything greater than sys->nr_copies.

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

diff --git a/sheep/group.c b/sheep/group.c
index ea02602..0c494bb 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -204,7 +204,7 @@ static int update_vnode_info(void)
 int get_nr_copies(struct vnode_info *vnode_info)
 {
 	int nr_copies = vnode_info->nr_zones;
-	if (nr_copies < sys->nr_copies)
+	if (nr_copies > sys->nr_copies)
 		nr_copies = sys->nr_copies;
 	return nr_copies;
 }
-- 
1.7.8.2




More information about the sheepdog mailing list