From patchwork Fri Dec 8 18:43:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 846396 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3yth7g4ZDrz9sP9; Sat, 9 Dec 2017 05:43:27 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eNNcH-0004mL-6p; Fri, 08 Dec 2017 18:43:21 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1eNNcF-0004lg-Ru for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:19 +0000 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=calabresa.spo.virtua.com.br) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1eNNcF-0002lg-6K for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:19 +0000 From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [Xenial SRU 1/6] Revert "libceph: MOSDOpReply v7 encoding" Date: Fri, 8 Dec 2017 16:43:08 -0200 Message-Id: <20171208184313.32316-2-cascardo@canonical.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171208184313.32316-1-cascardo@canonical.com> References: <20171208184313.32316-1-cascardo@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1737033 This reverts commit f14ca6ac3b198f30ee138f02c3c7d380d165736e. Signed-off-by: Thadeu Lima de Souza Cascardo --- include/linux/ceph/ceph_features.h | 5 +---- net/ceph/osd_client.c | 10 ---------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index c1ef6f14e7be..c3b211c9fe83 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h @@ -73,8 +73,6 @@ #define CEPH_FEATURE_MON_STATEFUL_SUB (1ULL<<57) /* stateful mon subscription */ #define CEPH_FEATURE_MON_ROUTE_OSDMAP (1ULL<<57) /* peon sends osdmaps */ #define CEPH_FEATURE_CRUSH_TUNABLES5 (1ULL<<58) /* chooseleaf stable mode */ -// duplicated since it was introduced at the same time as CEPH_FEATURE_CRUSH_TUNABLES5 -#define CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING (1ULL<<58) /* New, v7 encoding */ /* * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature @@ -121,8 +119,7 @@ static inline u64 ceph_sanitize_features(u64 features) CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \ CEPH_FEATURE_MSGR_KEEPALIVE2 | \ CEPH_FEATURE_CRUSH_V4 | \ - CEPH_FEATURE_CRUSH_TUNABLES5 | \ - CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING) + CEPH_FEATURE_CRUSH_TUNABLES5) #define CEPH_FEATURES_REQUIRED_DEFAULT \ (CEPH_FEATURE_NOSRCADDR | \ diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 5bc053778fed..a28e47ff1b1b 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1770,7 +1770,6 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg) u32 osdmap_epoch; int already_completed; u32 bytes; - u8 decode_redir; unsigned int i; tid = le64_to_cpu(msg->hdr.tid); @@ -1842,15 +1841,6 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg) p += 8 + 4; /* skip replay_version */ p += 8; /* skip user_version */ - if (le16_to_cpu(msg->hdr.version) >= 7) - ceph_decode_8_safe(&p, end, decode_redir, bad_put); - else - decode_redir = 1; - } else { - decode_redir = 0; - } - - if (decode_redir) { err = ceph_redirect_decode(&p, end, &redir); if (err) goto bad_put; From patchwork Fri Dec 8 18:43:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 846395 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3yth7g2ngXz9sNV; Sat, 9 Dec 2017 05:43:27 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eNNcJ-0004n0-Al; Fri, 08 Dec 2017 18:43:23 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1eNNcH-0004mF-0A for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:21 +0000 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=calabresa.spo.virtua.com.br) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1eNNcG-0002lg-Aq for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:20 +0000 From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [Xenial SRU 2/6] Revert "libceph: advertise support for TUNABLES5" Date: Fri, 8 Dec 2017 16:43:09 -0200 Message-Id: <20171208184313.32316-3-cascardo@canonical.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171208184313.32316-1-cascardo@canonical.com> References: <20171208184313.32316-1-cascardo@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1737033 This reverts commit 09ade67fc6224440719a94e8c8add556eb036437. Signed-off-by: Thadeu Lima de Souza Cascardo --- include/linux/ceph/ceph_features.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index c3b211c9fe83..f89b31d45cc8 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h @@ -63,16 +63,6 @@ #define CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY (1ULL<<49) // duplicated since it was introduced at the same time as MIN_SIZE_RECOVERY #define CEPH_FEATURE_OSD_PROXY_FEATURES (1ULL<<49) /* overlap w/ above */ -#define CEPH_FEATURE_MON_METADATA (1ULL<<50) -#define CEPH_FEATURE_OSD_BITWISE_HOBJ_SORT (1ULL<<51) /* can sort objs bitwise */ -#define CEPH_FEATURE_OSD_PROXY_WRITE_FEATURES (1ULL<<52) -#define CEPH_FEATURE_ERASURE_CODE_PLUGINS_V3 (1ULL<<53) -#define CEPH_FEATURE_OSD_HITSET_GMT (1ULL<<54) -#define CEPH_FEATURE_HAMMER_0_94_4 (1ULL<<55) -#define CEPH_FEATURE_NEW_OSDOP_ENCODING (1ULL<<56) /* New, v7 encoding */ -#define CEPH_FEATURE_MON_STATEFUL_SUB (1ULL<<57) /* stateful mon subscription */ -#define CEPH_FEATURE_MON_ROUTE_OSDMAP (1ULL<<57) /* peon sends osdmaps */ -#define CEPH_FEATURE_CRUSH_TUNABLES5 (1ULL<<58) /* chooseleaf stable mode */ /* * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature @@ -118,8 +108,7 @@ static inline u64 ceph_sanitize_features(u64 features) CEPH_FEATURE_CRUSH_TUNABLES3 | \ CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \ CEPH_FEATURE_MSGR_KEEPALIVE2 | \ - CEPH_FEATURE_CRUSH_V4 | \ - CEPH_FEATURE_CRUSH_TUNABLES5) + CEPH_FEATURE_CRUSH_V4) #define CEPH_FEATURES_REQUIRED_DEFAULT \ (CEPH_FEATURE_NOSRCADDR | \ From patchwork Fri Dec 8 18:43:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 846397 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3yth7h1QDhz9sRm; Sat, 9 Dec 2017 05:43:28 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eNNcJ-0004nW-K1; Fri, 08 Dec 2017 18:43:23 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1eNNcI-0004mm-59 for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:22 +0000 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=calabresa.spo.virtua.com.br) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1eNNcH-0002lg-FK for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:21 +0000 From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [Xenial SRU 3/6] Revert "crush: decode and initialize chooseleaf_stable" Date: Fri, 8 Dec 2017 16:43:10 -0200 Message-Id: <20171208184313.32316-4-cascardo@canonical.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171208184313.32316-1-cascardo@canonical.com> References: <20171208184313.32316-1-cascardo@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1737033 This reverts commit c043f509409e380281403f66c54794efbd5d0f02. Signed-off-by: Thadeu Lima de Souza Cascardo --- net/ceph/osdmap.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 94a9acbee51e..bc95e48d5cfb 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c @@ -342,32 +342,23 @@ static struct crush_map *crush_decode(void *pbyval, void *end) c->choose_local_tries = ceph_decode_32(p); c->choose_local_fallback_tries = ceph_decode_32(p); c->choose_total_tries = ceph_decode_32(p); - dout("crush decode tunable choose_local_tries = %d\n", + dout("crush decode tunable choose_local_tries = %d", c->choose_local_tries); - dout("crush decode tunable choose_local_fallback_tries = %d\n", + dout("crush decode tunable choose_local_fallback_tries = %d", c->choose_local_fallback_tries); - dout("crush decode tunable choose_total_tries = %d\n", + dout("crush decode tunable choose_total_tries = %d", c->choose_total_tries); ceph_decode_need(p, end, sizeof(u32), done); c->chooseleaf_descend_once = ceph_decode_32(p); - dout("crush decode tunable chooseleaf_descend_once = %d\n", + 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\n", + dout("crush decode tunable chooseleaf_vary_r = %d", c->chooseleaf_vary_r); - /* skip straw_calc_version, allowed_bucket_algs */ - ceph_decode_need(p, end, sizeof(u8) + sizeof(u32), done); - *p += sizeof(u8) + sizeof(u32); - - ceph_decode_need(p, end, sizeof(u8), done); - c->chooseleaf_stable = ceph_decode_8(p); - dout("crush decode tunable chooseleaf_stable = %d\n", - c->chooseleaf_stable); - done: dout("crush_decode success\n"); return c; From patchwork Fri Dec 8 18:43:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 846398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3yth7h2pWFz9sMN; Sat, 9 Dec 2017 05:43:28 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eNNcK-0004of-Qd; Fri, 08 Dec 2017 18:43:24 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1eNNcJ-0004my-9i for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:23 +0000 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=calabresa.spo.virtua.com.br) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1eNNcI-0002lg-KH for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:23 +0000 From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [Xenial SRU 4/6] Revert "crush: add chooseleaf_stable tunable" Date: Fri, 8 Dec 2017 16:43:11 -0200 Message-Id: <20171208184313.32316-5-cascardo@canonical.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171208184313.32316-1-cascardo@canonical.com> References: <20171208184313.32316-1-cascardo@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1737033 This reverts commit 74771960c7794994fd9067cdd8df0725b6ce75f6. Signed-off-by: Thadeu Lima de Souza Cascardo --- include/linux/crush/crush.h | 8 +------- net/ceph/crush/mapper.c | 18 ++++-------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h index be8f12b8f195..48b49305716b 100644 --- a/include/linux/crush/crush.h +++ b/include/linux/crush/crush.h @@ -59,8 +59,7 @@ enum { CRUSH_RULE_SET_CHOOSELEAF_TRIES = 9, /* override chooseleaf_descend_once */ CRUSH_RULE_SET_CHOOSE_LOCAL_TRIES = 10, CRUSH_RULE_SET_CHOOSE_LOCAL_FALLBACK_TRIES = 11, - CRUSH_RULE_SET_CHOOSELEAF_VARY_R = 12, - CRUSH_RULE_SET_CHOOSELEAF_STABLE = 13 + CRUSH_RULE_SET_CHOOSELEAF_VARY_R = 12 }; /* @@ -206,11 +205,6 @@ struct crush_map { * mappings line up a bit better with previous mappings. */ __u8 chooseleaf_vary_r; - /* if true, it makes chooseleaf firstn to return stable results (if - * no local retry) so that data migrations would be optimal when some - * device fails. */ - __u8 chooseleaf_stable; - #ifndef __KERNEL__ /* * version 0 (original) of straw_calc has various flaws. version 1 diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index 5fcfb98f309e..abb700621e4a 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c @@ -403,7 +403,6 @@ static int is_out(const struct crush_map *map, * @local_retries: localized retries * @local_fallback_retries: localized fallback retries * @recurse_to_leaf: true if we want one device under each item of given type (chooseleaf instead of choose) - * @stable: stable mode starts rep=0 in the recursive call for all replicas * @vary_r: pass r to recursive calls * @out2: second output vector for leaf items (if @recurse_to_leaf) * @parent_r: r value passed from the parent @@ -420,7 +419,6 @@ static int crush_choose_firstn(const struct crush_map *map, unsigned int local_fallback_retries, int recurse_to_leaf, unsigned int vary_r, - unsigned int stable, int *out2, int parent_r) { @@ -435,13 +433,13 @@ static int crush_choose_firstn(const struct crush_map *map, int collide, reject; int count = out_size; - dprintk("CHOOSE%s bucket %d x %d outpos %d numrep %d tries %d recurse_tries %d local_retries %d local_fallback_retries %d parent_r %d stable %d\n", + dprintk("CHOOSE%s bucket %d x %d outpos %d numrep %d tries %d recurse_tries %d local_retries %d local_fallback_retries %d parent_r %d\n", recurse_to_leaf ? "_LEAF" : "", bucket->id, x, outpos, numrep, tries, recurse_tries, local_retries, local_fallback_retries, - parent_r, stable); + parent_r); - for (rep = stable ? 0 : outpos; rep < numrep && count > 0 ; rep++) { + for (rep = outpos; rep < numrep && count > 0 ; rep++) { /* keep trying until we get a non-out, non-colliding item */ ftotal = 0; skip_rep = 0; @@ -514,14 +512,13 @@ static int crush_choose_firstn(const struct crush_map *map, if (crush_choose_firstn(map, map->buckets[-1-item], weight, weight_max, - x, stable ? 1 : outpos+1, 0, + x, outpos+1, 0, out2, outpos, count, recurse_tries, 0, local_retries, local_fallback_retries, 0, vary_r, - stable, NULL, sub_r) <= outpos) /* didn't get leaf */ @@ -819,7 +816,6 @@ int crush_do_rule(const struct crush_map *map, int choose_local_fallback_retries = map->choose_local_fallback_tries; int vary_r = map->chooseleaf_vary_r; - int stable = map->chooseleaf_stable; if ((__u32)ruleno >= map->max_rules) { dprintk(" bad ruleno %d\n", ruleno); @@ -874,11 +870,6 @@ int crush_do_rule(const struct crush_map *map, vary_r = curstep->arg1; break; - case CRUSH_RULE_SET_CHOOSELEAF_STABLE: - if (curstep->arg1 >= 0) - stable = curstep->arg1; - break; - case CRUSH_RULE_CHOOSELEAF_FIRSTN: case CRUSH_RULE_CHOOSE_FIRSTN: firstn = 1; @@ -941,7 +932,6 @@ int crush_do_rule(const struct crush_map *map, choose_local_fallback_retries, recurse_to_leaf, vary_r, - stable, c+osize, 0); } else { From patchwork Fri Dec 8 18:43:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 846399 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3yth7k0KMSz9sCZ; Sat, 9 Dec 2017 05:43:30 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eNNcL-0004qH-Uj; Fri, 08 Dec 2017 18:43:25 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1eNNcK-0004oI-EL for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:24 +0000 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=calabresa.spo.virtua.com.br) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1eNNcJ-0002lg-Of for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:24 +0000 From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [Xenial SRU 5/6] Revert "crush: ensure take bucket value is valid" Date: Fri, 8 Dec 2017 16:43:12 -0200 Message-Id: <20171208184313.32316-6-cascardo@canonical.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171208184313.32316-1-cascardo@canonical.com> References: <20171208184313.32316-1-cascardo@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1737033 This reverts commit 5a03f3043cb617cf2cf5ec9cbd0685d0e86e8b0e. Signed-off-by: Thadeu Lima de Souza Cascardo --- net/ceph/crush/mapper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index abb700621e4a..97ecf6f262aa 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c @@ -835,8 +835,7 @@ int crush_do_rule(const struct crush_map *map, case CRUSH_RULE_TAKE: if ((curstep->arg1 >= 0 && curstep->arg1 < map->max_devices) || - (-1-curstep->arg1 >= 0 && - -1-curstep->arg1 < map->max_buckets && + (-1-curstep->arg1 < map->max_buckets && map->buckets[-1-curstep->arg1])) { w[0] = curstep->arg1; wsize = 1; From patchwork Fri Dec 8 18:43:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 846400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3yth7m5Fq1z9s83; Sat, 9 Dec 2017 05:43:32 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eNNcP-0004sj-37; Fri, 08 Dec 2017 18:43:29 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1eNNcL-0004pp-JG for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:25 +0000 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=calabresa.spo.virtua.com.br) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1eNNcK-0002lg-Tj for kernel-team@lists.ubuntu.com; Fri, 08 Dec 2017 18:43:25 +0000 From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [Xenial SRU 6/6] Revert "crush: ensure bucket id is valid before indexing buckets array" Date: Fri, 8 Dec 2017 16:43:13 -0200 Message-Id: <20171208184313.32316-7-cascardo@canonical.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171208184313.32316-1-cascardo@canonical.com> References: <20171208184313.32316-1-cascardo@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1737033 This reverts commit 75ee940e71ed7841958cace371a5c79076a0378c. Signed-off-by: Thadeu Lima de Souza Cascardo --- net/ceph/crush/mapper.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index 97ecf6f262aa..393bfb22d5bb 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c @@ -888,7 +888,6 @@ int crush_do_rule(const struct crush_map *map, osize = 0; for (i = 0; i < wsize; i++) { - int bno; /* * see CRUSH_N, CRUSH_N_MINUS macros. * basically, numrep <= 0 means relative to @@ -901,13 +900,6 @@ int crush_do_rule(const struct crush_map *map, continue; } j = 0; - /* make sure bucket id is valid */ - bno = -1 - w[i]; - if (bno < 0 || bno >= map->max_buckets) { - /* w[i] is probably CRUSH_ITEM_NONE */ - dprintk(" bad w[i] %d\n", w[i]); - continue; - } if (firstn) { int recurse_tries; if (choose_leaf_tries) @@ -919,7 +911,7 @@ int crush_do_rule(const struct crush_map *map, recurse_tries = choose_tries; osize += crush_choose_firstn( map, - map->buckets[bno], + map->buckets[-1-w[i]], weight, weight_max, x, numrep, curstep->arg2, @@ -938,7 +930,7 @@ int crush_do_rule(const struct crush_map *map, numrep : (result_max-osize)); crush_choose_indep( map, - map->buckets[bno], + map->buckets[-1-w[i]], weight, weight_max, x, out_size, numrep, curstep->arg2,