From patchwork Mon May 12 12:17:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 4158791 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 972649F387 for ; Mon, 12 May 2014 12:17:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BFD86202DD for ; Mon, 12 May 2014 12:17:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F83A20260 for ; Mon, 12 May 2014 12:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755292AbaELMRn (ORCPT ); Mon, 12 May 2014 08:17:43 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:46934 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754597AbaELMRn (ORCPT ); Mon, 12 May 2014 08:17:43 -0400 Received: by mail-lb0-f181.google.com with SMTP id u14so7428656lbd.12 for ; Mon, 12 May 2014 05:17:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Hjhl1RhOQrl+rXKX8gkNvD8zH4KeDF+OKye3HB4DMeo=; b=mpC6bng9yQ85vvMy3a3FDJJoMpuDU4eq1SyV9XlIP6Xz8pMc8WQCQ+spFCEtXxz5qZ qd+muRAfCD9BLaosxvqfsYTxGlKAlVHHri30ge8vgPfsVTb8DPosil2quGAE8bpw5wYC EwuhIBOJ+NXKmXdJ6aixH28fjcYbQ8egu+Xg9X5pz8xyEnKcPHWAAV6XG/4W0j4egBOl Q3wdKiWztxgilzDaqxOMVE0TXtQN0Fnasz7o0IKx1K0u0inJBUtB2YuVynRYWnWSSU38 81LwwaoDPmz4lN6Xmyn1Ua+tAh5Kml6G4HQqyeJw88j6qLVny/MWjL0YdRqApQWfEidG CYhg== X-Gm-Message-State: ALoCoQkbZHIMqtgwlY2uHaM5b8/w5riyzdufNZzFCExu+PgGPNdyzrtJKd4MLpE1lKDyMop1dnp+ X-Received: by 10.112.158.101 with SMTP id wt5mr799947lbb.77.1399897061952; Mon, 12 May 2014 05:17:41 -0700 (PDT) Received: from localhost ([109.110.67.203]) by mx.google.com with ESMTPSA id cr6sm13689805lbb.19.2014.05.12.05.17.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 May 2014 05:17:41 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Dmitry Smirnov Subject: [PATCH] crush: decode and initialize chooseleaf_vary_r Date: Mon, 12 May 2014 16:17:39 +0400 Message-Id: <1399897059-4813-1-git-send-email-ilya.dryomov@inktank.com> X-Mailer: git-send-email 1.7.10.4 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, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Commit e2b149cc4ba0 ("crush: add chooseleaf_vary_r tunable") added the crush_map::chooseleaf_vary_r field but missed the decode part. This lead to misdirected requests caused by incorrect raw crush mapping sets. Fixes: http://tracker.ceph.com/issues/8226 Reported-and-Tested-by: Dmitry Smirnov Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil --- net/ceph/osdmap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 8b8a5a24b223..c547e46084d3 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c @@ -329,6 +329,11 @@ static struct crush_map *crush_decode(void *pbyval, void *end) dout("crush decode tunable chooseleaf_descend_once = %d", c->chooseleaf_descend_once); + ceph_decode_need(p, end, sizeof(u8), done); + c->chooseleaf_vary_r = ceph_decode_8(p); + dout("crush decode tunable chooseleaf_vary_r = %d", + c->chooseleaf_vary_r); + done: dout("crush_decode success\n"); return c;