[sheepdog] [PATCH stable-0.8 3/4] sheep/ops: fix potential type conversion error
Hitoshi Mitake
mitake.hitoshi at gmail.com
Tue Apr 22 16:57:24 CEST 2014
From: Ruoyu <liangry at ucweb.com>
Similar to lib/logger, epoch_log_read_with_timestamp will return -1
for any failure and it cannot be assigned to a variable in type of
size_t. Otherwise, the error branch will never be reached.
Signed-off-by: Ruoyu <liangry at ucweb.com>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
sheep/ops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sheep/ops.c b/sheep/ops.c
index fb3f95c..3e14d3b 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -449,7 +449,7 @@ static int local_stat_cluster(struct request *req)
max_elogs = req->rq.data_length / sizeof(*elog);
epoch = get_latest_epoch();
for (i = 0; i < max_elogs; i++) {
- size_t nr_nodes;
+ int nr_nodes;
if (epoch <= 0)
break;
--
1.8.3.2
More information about the sheepdog
mailing list