All of lore.kernel.org
 help / color / mirror / Atom feed
* I found some problem in CRUSH code
@ 2012-02-15 13:51 ZhuRongze
  2012-02-23 18:54 ` Sage Weil
  0 siblings, 1 reply; 2+ messages in thread
From: ZhuRongze @ 2012-02-15 13:51 UTC (permalink / raw)
  To: ceph-devel

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

Hi,

The function crush_adjust_tree_bucket_item_weight in 
ceph-0.41/src/crush/builder.c seem to  have a bug. The argument weight 
is no use, because it is assigned .
--------------------------------------------------------------------
int crush_adjust_tree_bucket_item_weight(struct crush_bucket_tree 
*bucket, int item, int weight)
{
     int diff;
     int node;
     unsigned i, j;
     unsigned depth = calc_depth(bucket->h.size);

     for (i = 0; i < bucket->h.size; i++) {
         if (bucket->h.items[i] == item)
             break;
     }
     if (i == bucket->h.size)
         return 0;

     node = crush_calc_tree_node(i);
     diff = weight = bucket->node_weights[node];
     bucket->node_weights[node] = weight;
     bucket->h.weight += diff;

     for (j=1; j<depth; j++) {
         node = parent(node);
         bucket->node_weights[node] += diff;
     }

     return diff;

--------------------------------------------------------------------
The function crush_adjust_list_bucket_item_weight also have a same problem.

-ZhuRongze

[-- Attachment #2: zrz4ceph.vcf --]
[-- Type: text/x-vcard, Size: 82 bytes --]

begin:vcard
fn:Rongze Zhu
n:Zhu;Rongze
org:SINA;SWS
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: I found some problem in CRUSH code
  2012-02-15 13:51 I found some problem in CRUSH code ZhuRongze
@ 2012-02-23 18:54 ` Sage Weil
  0 siblings, 0 replies; 2+ messages in thread
From: Sage Weil @ 2012-02-23 18:54 UTC (permalink / raw)
  To: ZhuRongze; +Cc: ceph-devel

Hi,

Yes, that's a bug... Those ='s should be -, as with the straw bucket type.  
Opened http://tracker.newdream.net/issues/2096

Thanks!  This'll be fixed in v0.43.
sage


On Wed, 15 Feb 2012, ZhuRongze wrote:

> Hi,
> 
> The function crush_adjust_tree_bucket_item_weight in
> ceph-0.41/src/crush/builder.c seem to  have a bug. The argument weight is no
> use, because it is assigned .
> --------------------------------------------------------------------
> int crush_adjust_tree_bucket_item_weight(struct crush_bucket_tree *bucket, int
> item, int weight)
> {
>     int diff;
>     int node;
>     unsigned i, j;
>     unsigned depth = calc_depth(bucket->h.size);
> 
>     for (i = 0; i < bucket->h.size; i++) {
>         if (bucket->h.items[i] == item)
>             break;
>     }
>     if (i == bucket->h.size)
>         return 0;
> 
>     node = crush_calc_tree_node(i);
>     diff = weight = bucket->node_weights[node];
>     bucket->node_weights[node] = weight;
>     bucket->h.weight += diff;
> 
>     for (j=1; j<depth; j++) {
>         node = parent(node);
>         bucket->node_weights[node] += diff;
>     }
> 
>     return diff;
> 
> --------------------------------------------------------------------
> The function crush_adjust_list_bucket_item_weight also have a same problem.
> 
> -ZhuRongze
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-23 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 13:51 I found some problem in CRUSH code ZhuRongze
2012-02-23 18:54 ` Sage Weil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.