From patchwork Wed Aug 13 13:38:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viral Mehta X-Patchwork-Id: 4719121 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CBBB69F319 for ; Wed, 13 Aug 2014 13:38:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1C14201B9 for ; Wed, 13 Aug 2014 13:38:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1DF82018B for ; Wed, 13 Aug 2014 13:38:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752584AbaHMNiO (ORCPT ); Wed, 13 Aug 2014 09:38:14 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:55265 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134AbaHMNiN (ORCPT ); Wed, 13 Aug 2014 09:38:13 -0400 Received: by mail-pd0-f176.google.com with SMTP id y10so14349410pdj.7 for ; Wed, 13 Aug 2014 06:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=56TYTP3MPeXMBDRh8a/tD+DnzgSz5TLI9sKWULzPIgw=; b=Y/8+mKJ7wjwEQc3ZJcVSQsMsAphRoBoqL87ps6VaRg9u69j4nGSiIS/XWsydgMS92m yjJsapDqFYYnqsJzJC3o5jPUyc3vj3c3/J3+sIy82tuZo27YUm50R21ACN3WUZky4Bhk Ci6RZUDoQm0KCbTUPWu6KI9wby5O+vicecKsDS49wqYDUXZ4zH1oD0CPmzWhrD0C92Xu ZKXNspHWeF1HNGDPfKeeba0pcfoQBWT3z4MSAf0jLyRypvf5GiF8R1RPrqWlj0smFiYf K7Ea2zbj5/m+bF9UPer+h/BcISrO/N42Yk6xJqwLYA/4Ejb/81axj0tpfoPkREwVRGrW kqew== MIME-Version: 1.0 X-Received: by 10.68.68.143 with SMTP id w15mr4220851pbt.134.1407937093117; Wed, 13 Aug 2014 06:38:13 -0700 (PDT) Received: by 10.70.34.194 with HTTP; Wed, 13 Aug 2014 06:38:13 -0700 (PDT) In-Reply-To: References: Date: Wed, 13 Aug 2014 19:08:13 +0530 Message-ID: Subject: Fwd: crush_addition_is_unsafe From: Viral Mehta To: ceph-devel@vger.kernel.org Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Does this make sense ? I can prepare a patch. return -ERANGE; bucket->node_weights[node] += weight; diff --git a/src/crush/builder.c b/src/crush/builder.c index c319620..5700a88 100644 --- a/src/crush/builder.c +++ b/src/crush/builder.c @@ -651,7 +651,7 @@ int crush_add_tree_bucket_item(struct crush_bucket_tree *bucket, int item, int w for (j=1; jnode_weights[node], weight)) + if (crush_addition_is_unsafe(bucket->node_weights[node], weight))