All of lore.kernel.org
 help / color / mirror / Atom feed
From: ZhuRongze <zrz4ceph@gmail.com>
To: ceph-devel <ceph-devel@vger.kernel.org>
Subject: I found some problem in CRUSH code
Date: Wed, 15 Feb 2012 21:51:10 +0800	[thread overview]
Message-ID: <4F3BB84E.50209@gmail.com> (raw)

[-- 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


             reply	other threads:[~2012-02-15 13:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15 13:51 ZhuRongze [this message]
2012-02-23 18:54 ` I found some problem in CRUSH code Sage Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F3BB84E.50209@gmail.com \
    --to=zrz4ceph@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.