<div dir="ltr">Reviewed-by: Robin Dong <<a href="mailto:sanbai@taobao.com">sanbai@taobao.com</a>></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/3 Liu Yuan <span dir="ltr"><<a href="mailto:namei.unix@gmail.com" target="_blank">namei.unix@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">If we assign the integer to a wider one, the width of that integer isn't<br>
automatically converted and then we'll get a partial valume.<br>
<br>
This fix following problem:<br>
<br>
sheep -w size=1T # which will overflow a 32bit integer<br>
dog vdi cache info # will get a wrong value<br>
<br>
Signed-off-by: Liu Yuan <<a href="mailto:namei.unix@gmail.com">namei.unix@gmail.com</a>><br>
---<br>
 sheep/object_cache.c |    4 ++--<br>
 1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/sheep/object_cache.c b/sheep/object_cache.c<br>
</div>index 3df88fd..10a051c 100644<br>
<div class="im">--- a/sheep/object_cache.c<br>
+++ b/sheep/object_cache.c<br>
@@ -1372,8 +1372,8 @@ int object_cache_get_info(struct object_cache_info *info)<br>
 {<br>
        int j = 0;<br>
<br>
-       info->used = gcache.capacity * 1024 * 1024;<br>
-       info->size = sys->object_cache_size * 1024 * 1024;<br>
</div>+       info->used = (uint64_t)gcache.capacity * 1024 * 1024;<br>
+       info->size = (uint64_t)sys->object_cache_size * 1024 * 1024;<br>
<div class="im HOEnZb"><br>
        for (int i = 0; i < HASH_SIZE; i++) {<br>
                struct hlist_head *head = cache_hashtable + i;<br>
--<br>
1.7.9.5<br>
<br>
</div><div class="HOEnZb"><div class="h5">--<br>
sheepdog mailing list<br>
<a href="mailto:sheepdog@lists.wpkg.org">sheepdog@lists.wpkg.org</a><br>
<a href="http://lists.wpkg.org/mailman/listinfo/sheepdog" target="_blank">http://lists.wpkg.org/mailman/listinfo/sheepdog</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>--<br>Best Regard<br>Robin Dong
</div>