From patchwork Wed Jun 5 13:10:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10976943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78D5815E6 for ; Wed, 5 Jun 2019 13:11:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CF2728706 for ; Wed, 5 Jun 2019 13:11:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B74028710; Wed, 5 Jun 2019 13:11:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7A2228981 for ; Wed, 5 Jun 2019 13:11:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727964AbfFENLG (ORCPT ); Wed, 5 Jun 2019 09:11:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:59434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727941AbfFENLF (ORCPT ); Wed, 5 Jun 2019 09:11:05 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D384206DF; Wed, 5 Jun 2019 13:11:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559740264; bh=W/1nNP043GIFmko2NoTM4G0lEwx1P5uyXRRnd+gW9ZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V00EeiOInYlgqzAnzo6IBDSUUYxVOJjmVOcarcWx7AvZuzES1ozsYyB3/OFXZ81ml N+PNrtzDQa3mJTm1kBupBPrkNKUooYHnaZj58rQ4uAF/YxtaP3H6YOIdhLUNVMlWVO tQS6ENs51Iuqt1+LotX5G4YorRlhWFc2hChfF2kE= From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@redhat.com, zyan@redhat.com, sage@redhat.com Subject: [RFC PATCH 1/9] libceph: fix sa_family just after reading address Date: Wed, 5 Jun 2019 09:10:54 -0400 Message-Id: <20190605131102.13529-2-jlayton@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190605131102.13529-1-jlayton@kernel.org> References: <20190605131102.13529-1-jlayton@kernel.org> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It doesn't make sense to leave it undecoded until later. Signed-off-by: Jeff Layton --- net/ceph/messenger.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 3ee380758ddd..a25e71fa8124 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1732,12 +1732,14 @@ static int read_partial_banner(struct ceph_connection *con) ret = read_partial(con, end, size, &con->actual_peer_addr); if (ret <= 0) goto out; + ceph_decode_addr(&con->actual_peer_addr); size = sizeof (con->peer_addr_for_me); end += size; ret = read_partial(con, end, size, &con->peer_addr_for_me); if (ret <= 0) goto out; + ceph_decode_addr(&con->peer_addr_for_me); out: return ret; @@ -2010,9 +2012,6 @@ static int process_banner(struct ceph_connection *con) if (verify_hello(con) < 0) return -1; - ceph_decode_addr(&con->actual_peer_addr); - ceph_decode_addr(&con->peer_addr_for_me); - /* * Make sure the other end is who we wanted. note that the other * end may not yet know their ip address, so if it's 0.0.0.0, give From patchwork Wed Jun 5 13:10:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10976945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EC7992A for ; Wed, 5 Jun 2019 13:11:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F98B28984 for ; Wed, 5 Jun 2019 13:11:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4280E28986; Wed, 5 Jun 2019 13:11:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0488285FD for ; Wed, 5 Jun 2019 13:11:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727995AbfFENLH (ORCPT ); Wed, 5 Jun 2019 09:11:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:59444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbfFENLG (ORCPT ); Wed, 5 Jun 2019 09:11:06 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 23DB720717; Wed, 5 Jun 2019 13:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559740265; bh=6akkNGTL8xzICECoOjR8XdMuLuWzUEj0wLgVC5S01M8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ARjHZ+KlTG0dLV8vQmwQW13JXnWowBh6SQK+s1cb8Fp0+OTWrdZp7NfICF8H6qHFn HSCCBQkO2F92MxMLGOHIpYi/B69eg65dFLIhsp0uoMaNp/BlbqekPZSRDvipyQ7fse QghgKCrOxWnQWiwtX0iYYfTl/egGdskKFYmfkhhg= From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@redhat.com, zyan@redhat.com, sage@redhat.com Subject: [RFC PATCH 2/9] libceph: add ceph_decode_entity_addr Date: Wed, 5 Jun 2019 09:10:55 -0400 Message-Id: <20190605131102.13529-3-jlayton@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190605131102.13529-1-jlayton@kernel.org> References: <20190605131102.13529-1-jlayton@kernel.org> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a way to decode an entity_addr_t. Once CEPH_FEATURE_MSG_ADDR2 is enabled, the server daemons will start encoding entity_addr_t differently. Add a new helper function that can handle either format. Signed-off-by: Jeff Layton --- include/linux/ceph/decode.h | 2 + net/ceph/Makefile | 2 +- net/ceph/decode.c | 75 +++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 net/ceph/decode.c diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index a6c2a48d42e0..1c0a665bfc03 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h @@ -230,6 +230,8 @@ static inline void ceph_decode_addr(struct ceph_entity_addr *a) WARN_ON(a->in_addr.ss_family == 512); } +extern int ceph_decode_entity_addr(void **p, void *end, + struct ceph_entity_addr *addr); /* * encoders */ diff --git a/net/ceph/Makefile b/net/ceph/Makefile index db09defe27d0..59d0ba2072de 100644 --- a/net/ceph/Makefile +++ b/net/ceph/Makefile @@ -5,7 +5,7 @@ obj-$(CONFIG_CEPH_LIB) += libceph.o libceph-y := ceph_common.o messenger.o msgpool.o buffer.o pagelist.o \ - mon_client.o \ + mon_client.o decode.o \ cls_lock_client.o \ osd_client.o osdmap.o crush/crush.o crush/mapper.o crush/hash.o \ striper.o \ diff --git a/net/ceph/decode.c b/net/ceph/decode.c new file mode 100644 index 000000000000..27edf5d341ec --- /dev/null +++ b/net/ceph/decode.c @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +int +ceph_decode_entity_addr(void **p, void *end, struct ceph_entity_addr *addr) +{ + u8 marker, v, compat; + u32 len; + + ceph_decode_8_safe(p, end, marker, bad); + if (marker == 1) { + ceph_decode_8_safe(p, end, v, bad); + ceph_decode_8_safe(p, end, compat, bad); + if (!v || compat != 1) + goto bad; + /* FIXME: sanity check? */ + ceph_decode_32_safe(p, end, len, bad); + /* type is __le32, so we must copy into place as-is */ + ceph_decode_copy_safe(p, end, &addr->type, + sizeof(addr->type), bad); + + /* + * TYPE_NONE == 0 + * TYPE_LEGACY == 1 + * + * Clients that don't support ADDR2 always send TYPE_NONE. + * For now, since all we support is msgr1, just set this to 0 + * when we get a TYPE_LEGACY type. + */ + if (addr->type == cpu_to_le32(1)) + addr->type = 0; + } else if (marker == 0) { + addr->type = 0; + /* Skip rest of type field */ + ceph_decode_skip_n(p, end, 3, bad); + } else { + goto bad; + } + + ceph_decode_need(p, end, sizeof(addr->nonce), bad); + ceph_decode_copy(p, &addr->nonce, sizeof(addr->nonce)); + + /* addr length */ + if (marker == 1) { + ceph_decode_32_safe(p, end, len, bad); + if (len > sizeof(addr->in_addr)) + goto bad; + } else { + len = sizeof(addr->in_addr); + } + + memset(&addr->in_addr, 0, sizeof(addr->in_addr)); + + if (len) { + ceph_decode_need(p, end, len, bad); + ceph_decode_copy(p, &addr->in_addr, len); + + /* + * Fix up sa_family. Legacy encoding sends it in BE, addr2 + * encoding uses LE. + */ + if (marker == 1) + addr->in_addr.ss_family = + le16_to_cpu((__force __le16)addr->in_addr.ss_family); + else + addr->in_addr.ss_family = + be16_to_cpu((__force __be16)addr->in_addr.ss_family); + } + return 0; +bad: + return -EINVAL; +} +EXPORT_SYMBOL(ceph_decode_entity_addr); + From patchwork Wed Jun 5 13:10:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10976949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF66F14B6 for ; Wed, 5 Jun 2019 13:11:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF8FA2793A for ; Wed, 5 Jun 2019 13:11:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3F7228985; Wed, 5 Jun 2019 13:11:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4619A285FD for ; Wed, 5 Jun 2019 13:11:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728010AbfFENLJ (ORCPT ); Wed, 5 Jun 2019 09:11:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:59452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727941AbfFENLH (ORCPT ); Wed, 5 Jun 2019 09:11:07 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF79A20872; Wed, 5 Jun 2019 13:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559740266; bh=jN4Nd0DgRTJzBR2hdGQM1XAVgCysmLa1W1f+b3ABosE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1aJLNeHmNUZB6Ztg5Vkt69dh/C6jI+kVAVidICoKaaFga3C/KsSpdifaKwBHqSlVy nwmQOcxdWlxh2TjhnJcRGH0XJS4uKL+o9P2pmv9WlyyzARxRucDUx3JYJkTpniAgJz +NUuqHlwMNEcYBg34Zowy0yGULnlPcp1KB0Dxk4Q= From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@redhat.com, zyan@redhat.com, sage@redhat.com Subject: [RFC PATCH 3/9] libceph: ADDR2 support for monmap Date: Wed, 5 Jun 2019 09:10:56 -0400 Message-Id: <20190605131102.13529-4-jlayton@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190605131102.13529-1-jlayton@kernel.org> References: <20190605131102.13529-1-jlayton@kernel.org> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Switch the MonMap decoder to use the new decoding routine for entity_addr_t's. Signed-off-by: Jeff Layton --- include/linux/ceph/mon_client.h | 1 - net/ceph/mon_client.c | 21 +++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/linux/ceph/mon_client.h b/include/linux/ceph/mon_client.h index 3a4688af7455..b4d134d3312a 100644 --- a/include/linux/ceph/mon_client.h +++ b/include/linux/ceph/mon_client.h @@ -104,7 +104,6 @@ struct ceph_mon_client { #endif }; -extern struct ceph_monmap *ceph_monmap_decode(void *p, void *end); extern int ceph_monmap_contains(struct ceph_monmap *m, struct ceph_entity_addr *addr); diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index 895679d3529b..0520bf9825aa 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c @@ -39,7 +39,7 @@ static int __validate_auth(struct ceph_mon_client *monc); /* * Decode a monmap blob (e.g., during mount). */ -struct ceph_monmap *ceph_monmap_decode(void *p, void *end) +static struct ceph_monmap *ceph_monmap_decode(void *p, void *end) { struct ceph_monmap *m = NULL; int i, err = -EINVAL; @@ -50,7 +50,7 @@ struct ceph_monmap *ceph_monmap_decode(void *p, void *end) ceph_decode_32_safe(&p, end, len, bad); ceph_decode_need(&p, end, len, bad); - dout("monmap_decode %p %p len %d\n", p, end, (int)(end-p)); + dout("monmap_decode %p %p len %d (%d)\n", p, end, len, (int)(end-p)); p += sizeof(u16); /* skip version */ ceph_decode_need(&p, end, sizeof(fsid) + 2*sizeof(u32), bad); @@ -58,7 +58,6 @@ struct ceph_monmap *ceph_monmap_decode(void *p, void *end) epoch = ceph_decode_32(&p); num_mon = ceph_decode_32(&p); - ceph_decode_need(&p, end, num_mon*sizeof(m->mon_inst[0]), bad); if (num_mon > CEPH_MAX_MON) goto bad; @@ -68,17 +67,22 @@ struct ceph_monmap *ceph_monmap_decode(void *p, void *end) m->fsid = fsid; m->epoch = epoch; m->num_mon = num_mon; - ceph_decode_copy(&p, m->mon_inst, num_mon*sizeof(m->mon_inst[0])); - for (i = 0; i < num_mon; i++) - ceph_decode_addr(&m->mon_inst[i].addr); - + for (i = 0; i < num_mon; ++i) { + struct ceph_entity_inst *inst = &m->mon_inst[i]; + + /* copy name portion */ + ceph_decode_copy_safe(&p, end, &inst->name, + sizeof(inst->name), bad); + err = ceph_decode_entity_addr(&p, end, &inst->addr); + if (err) + goto bad; + } dout("monmap_decode epoch %d, num_mon %d\n", m->epoch, m->num_mon); for (i = 0; i < m->num_mon; i++) dout("monmap_decode mon%d is %s\n", i, ceph_pr_addr(&m->mon_inst[i].addr)); return m; - bad: dout("monmap_decode failed with %d\n", err); kfree(m); @@ -469,6 +473,7 @@ static void ceph_monc_handle_map(struct ceph_mon_client *monc, if (IS_ERR(monmap)) { pr_err("problem decoding monmap, %d\n", (int)PTR_ERR(monmap)); + ceph_msg_dump(msg); goto out; } From patchwork Wed Jun 5 13:10:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10976947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91B8292A for ; Wed, 5 Jun 2019 13:11:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84C742793A for ; Wed, 5 Jun 2019 13:11:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7830E28985; Wed, 5 Jun 2019 13:11:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C3BB2793A for ; Wed, 5 Jun 2019 13:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728004AbfFENLI (ORCPT ); Wed, 5 Jun 2019 09:11:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:59458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbfFENLH (ORCPT ); Wed, 5 Jun 2019 09:11:07 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A4FDB20874; Wed, 5 Jun 2019 13:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559740267; bh=mYFbO6z0xwV6my6cGOyFNrN4RWuepkjibLLeJYv4iZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y4LpmMn01Qc9mQIJQZE1tZb2rUPR7sawOUFz696o++7NIwb1Rpk6Qhd8XpTc6GZM7 6IUMOQew5gKvEFhJoH99Wm0psi9VSHmRg7BHzbESnEtUBx6t1jiEuTsUbbRj38Xxar GinSUZrF/eI3dhuZ3xMoBxisC2d2zFtWgz1+wZHc= From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@redhat.com, zyan@redhat.com, sage@redhat.com Subject: [RFC PATCH 4/9] libceph: switch osdmap decoding to use ceph_decode_entity_addr Date: Wed, 5 Jun 2019 09:10:57 -0400 Message-Id: <20190605131102.13529-5-jlayton@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190605131102.13529-1-jlayton@kernel.org> References: <20190605131102.13529-1-jlayton@kernel.org> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jeff Layton --- net/ceph/osdmap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 48a31dc9161c..95e98ae59a54 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c @@ -1489,11 +1489,9 @@ static int osdmap_decode(void **p, void *end, struct ceph_osdmap *map) /* osd_state, osd_weight, osd_addrs->client_addr */ ceph_decode_need(p, end, 3*sizeof(u32) + - map->max_osd*((struct_v >= 5 ? sizeof(u32) : - sizeof(u8)) + - sizeof(*map->osd_weight) + - sizeof(*map->osd_addr)), e_inval); - + map->max_osd*(struct_v >= 5 ? sizeof(u32) : + sizeof(u8)) + + sizeof(*map->osd_weight), e_inval); if (ceph_decode_32(p) != map->max_osd) goto e_inval; @@ -1514,9 +1512,11 @@ static int osdmap_decode(void **p, void *end, struct ceph_osdmap *map) if (ceph_decode_32(p) != map->max_osd) goto e_inval; - ceph_decode_copy(p, map->osd_addr, map->max_osd*sizeof(*map->osd_addr)); - for (i = 0; i < map->max_osd; i++) - ceph_decode_addr(&map->osd_addr[i]); + for (i = 0; i < map->max_osd; i++) { + err = ceph_decode_entity_addr(p, end, &map->osd_addr[i]); + if (err) + goto bad; + } /* pg_temp */ err = decode_pg_temp(p, end, map); From patchwork Wed Jun 5 13:10:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10976951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E742492A for ; Wed, 5 Jun 2019 13:11:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA46E28520 for ; Wed, 5 Jun 2019 13:11:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEC88285FD; Wed, 5 Jun 2019 13:11:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 854A42897C for ; Wed, 5 Jun 2019 13:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728025AbfFENLL (ORCPT ); Wed, 5 Jun 2019 09:11:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:59464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728003AbfFENLI (ORCPT ); Wed, 5 Jun 2019 09:11:08 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7235C20883; Wed, 5 Jun 2019 13:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559740268; bh=VyMGwNHbNW332OuFcFpZGqUXUtoxNFAGNBioKLMK8Mw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xRd9klNLKP/4OtFpLbE7+mmQdxV+W1YWOHiDYh7SMYOEBkdaYYYks59z5/99+eMdR TCC+1XIU3dr9ltjb4brRtnTO1cg+Spgf0o9qKaE9sMsHRfiY+cLW93u3ddzUW3FJh7 E6lFoVF8oM2GVirjhrWtvhaM7qpnGMQuHObIqmsg= From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@redhat.com, zyan@redhat.com, sage@redhat.com Subject: [RFC PATCH 5/9] libceph: fix watch_item_t decoding to use ceph_decode_entity_addr Date: Wed, 5 Jun 2019 09:10:58 -0400 Message-Id: <20190605131102.13529-6-jlayton@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190605131102.13529-1-jlayton@kernel.org> References: <20190605131102.13529-1-jlayton@kernel.org> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While we're in there, let's also fix up the decoder to do proper bounds checking. Signed-off-by: Jeff Layton --- net/ceph/osd_client.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index e6d31e0f0289..f8a4d29ef688 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -4914,20 +4914,26 @@ static int decode_watcher(void **p, void *end, struct ceph_watch_item *item) ret = ceph_start_decoding(p, end, 2, "watch_item_t", &struct_v, &struct_len); if (ret) - return ret; + goto bad; + + ret = -EINVAL; + ceph_decode_copy_safe(p, end, &item->name, sizeof(item->name), bad); + ceph_decode_64_safe(p, end, item->cookie, bad); + ceph_decode_skip_32(p, end, bad); /* skip timeout seconds */ - ceph_decode_copy(p, &item->name, sizeof(item->name)); - item->cookie = ceph_decode_64(p); - *p += 4; /* skip timeout_seconds */ if (struct_v >= 2) { - ceph_decode_copy(p, &item->addr, sizeof(item->addr)); - ceph_decode_addr(&item->addr); + ret = ceph_decode_entity_addr(p, end, &item->addr); + if (ret) + goto bad; + } else { + ret = 0; } dout("%s %s%llu cookie %llu addr %s\n", __func__, ENTITY_NAME(item->name), item->cookie, ceph_pr_addr(&item->addr)); - return 0; +bad: + return ret; } static int decode_watchers(void **p, void *end, From patchwork Wed Jun 5 13:10:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10976955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EB9114B6 for ; Wed, 5 Jun 2019 13:11:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81C932832D for ; Wed, 5 Jun 2019 13:11:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7466528985; Wed, 5 Jun 2019 13:11:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1217D2832D for ; Wed, 5 Jun 2019 13:11:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728015AbfFENLK (ORCPT ); Wed, 5 Jun 2019 09:11:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:59466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728009AbfFENLJ (ORCPT ); Wed, 5 Jun 2019 09:11:09 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39E182089E; Wed, 5 Jun 2019 13:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559740268; bh=r6OZ5ULp+6V4Rtq5MkU/csIINVDLzaMk0vdOMTcVwU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H7NlxjyDvNm18wXDJc/RHmLztwdBaHyzfG4H5bkHc0gON0nDcq6IMZBiSatYf74VK vaYJ1/UW9yajMjDBGWQLr5I6C6DA9XiNGXf+jSi0mN+7wC4zaJewARuHCQbbqmnsnX Ss+o+LTp4ECclv/DHn+VFxeov5VDeNpJzx2+FvNI= From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@redhat.com, zyan@redhat.com, sage@redhat.com Subject: [RFC PATCH 6/9] libceph: correctly decode ADDR2 addresses in incremental OSD maps Date: Wed, 5 Jun 2019 09:10:59 -0400 Message-Id: <20190605131102.13529-7-jlayton@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190605131102.13529-1-jlayton@kernel.org> References: <20190605131102.13529-1-jlayton@kernel.org> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Given the new format, we have to decode the addresses twice. Once to skip past the new_up_client field, and a second time to collect the addresses. Signed-off-by: Jeff Layton --- net/ceph/osdmap.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 95e98ae59a54..90437906b7bc 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c @@ -1618,12 +1618,17 @@ static int decode_new_up_state_weight(void **p, void *end, u8 struct_v, void *new_state; void *new_weight_end; u32 len; + int i; new_up_client = *p; ceph_decode_32_safe(p, end, len, e_inval); - len *= sizeof(u32) + sizeof(struct ceph_entity_addr); - ceph_decode_need(p, end, len, e_inval); - *p += len; + for (i = 0; i < len; ++i) { + struct ceph_entity_addr addr; + + ceph_decode_skip_32(p, end, e_inval); + if (ceph_decode_entity_addr(p, end, &addr)) + goto e_inval; + } new_state = *p; ceph_decode_32_safe(p, end, len, e_inval); @@ -1699,9 +1704,9 @@ static int decode_new_up_state_weight(void **p, void *end, u8 struct_v, struct ceph_entity_addr addr; osd = ceph_decode_32(p); - ceph_decode_copy(p, &addr, sizeof(addr)); - ceph_decode_addr(&addr); BUG_ON(osd >= map->max_osd); + if (ceph_decode_entity_addr(p, end, &addr)) + goto e_inval; pr_info("osd%d up\n", osd); map->osd_state[osd] |= CEPH_OSD_EXISTS | CEPH_OSD_UP; map->osd_addr[osd] = addr; From patchwork Wed Jun 5 13:11:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10976957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 988A015E6 for ; Wed, 5 Jun 2019 13:11:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 899B928984 for ; Wed, 5 Jun 2019 13:11:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E4B328520; Wed, 5 Jun 2019 13:11:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31E31285FD for ; Wed, 5 Jun 2019 13:11:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728022AbfFENLL (ORCPT ); Wed, 5 Jun 2019 09:11:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:59468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727941AbfFENLJ (ORCPT ); Wed, 5 Jun 2019 09:11:09 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00BBE208C0; Wed, 5 Jun 2019 13:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559740269; bh=a4raB1j9zeZMXJgACb2Qxi7E0ANgGX6SjRdOV19rXTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SFto/I5pTtQj5F6yx/DvnqYGpnznvr+hGmGubqIAkW3A/OTiwXvh2Quf7h2hqYAs4 F34q5lQMEoIWmldV3rza2B7Rp5g9i0QZmgnmlRkPhrlBieAEs+AGXHnwIs/Yv88b4T GoqaVyH6H1n0oxt0aJs1pZb6A+4WWYpPHx+/GVgI= From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@redhat.com, zyan@redhat.com, sage@redhat.com Subject: [RFC PATCH 7/9] ceph: have MDS map decoding use entity_addr_t decoder Date: Wed, 5 Jun 2019 09:11:00 -0400 Message-Id: <20190605131102.13529-8-jlayton@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190605131102.13529-1-jlayton@kernel.org> References: <20190605131102.13529-1-jlayton@kernel.org> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jeff Layton --- fs/ceph/mdsmap.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/ceph/mdsmap.c b/fs/ceph/mdsmap.c index 45a815c7975e..98814c3d18c9 100644 --- a/fs/ceph/mdsmap.c +++ b/fs/ceph/mdsmap.c @@ -107,7 +107,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) struct ceph_mdsmap *m; const void *start = *p; int i, j, n; - int err = -EINVAL; + int err; u8 mdsmap_v, mdsmap_cv; u16 mdsmap_ev; @@ -183,8 +183,9 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) inc = ceph_decode_32(p); state = ceph_decode_32(p); state_seq = ceph_decode_64(p); - ceph_decode_copy(p, &addr, sizeof(addr)); - ceph_decode_addr(&addr); + err = ceph_decode_entity_addr(p, end, &addr); + if (err) + goto corrupt; ceph_decode_copy(p, &laggy_since, sizeof(laggy_since)); *p += sizeof(u32); ceph_decode_32_safe(p, end, namelen, bad); @@ -357,7 +358,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) nomem: err = -ENOMEM; goto out_err; -bad: +corrupt: pr_err("corrupt mdsmap\n"); print_hex_dump(KERN_DEBUG, "mdsmap: ", DUMP_PREFIX_OFFSET, 16, 1, @@ -365,6 +366,9 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) out_err: ceph_mdsmap_destroy(m); return ERR_PTR(err); +bad: + err = -EINVAL; + goto corrupt; } void ceph_mdsmap_destroy(struct ceph_mdsmap *m) From patchwork Wed Jun 5 13:11:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10976953 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5771915E6 for ; Wed, 5 Jun 2019 13:11:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48F9527F93 for ; Wed, 5 Jun 2019 13:11:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47812285FD; Wed, 5 Jun 2019 13:11:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05BD0285FD for ; Wed, 5 Jun 2019 13:11:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728028AbfFENLM (ORCPT ); Wed, 5 Jun 2019 09:11:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:59474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728019AbfFENLK (ORCPT ); Wed, 5 Jun 2019 09:11:10 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BCE2B208C3; Wed, 5 Jun 2019 13:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559740270; bh=9zYSPCwH1COREnyQ9mwNLnIL8R0j/51AlLUcdGE7do8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HX/gKBTiHQRxizKVIpJRva8pA4myXlLWX4ded29VrTjFPiCAlBBRtpnlYXJoNPwtq epYrBLV49N4YtlkhtHV2+OFnfpFrDiHJHK4yhZI3ra1IUXT5YVL6ZzrWgYsqtFS7Wx T9+bXQKThPQL6xiFMxrViHIAOeip5rG9kHzb+QbM= From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@redhat.com, zyan@redhat.com, sage@redhat.com Subject: [RFC PATCH 8/9] ceph: fix decode_locker to use ceph_decode_entity_addr Date: Wed, 5 Jun 2019 09:11:01 -0400 Message-Id: <20190605131102.13529-9-jlayton@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190605131102.13529-1-jlayton@kernel.org> References: <20190605131102.13529-1-jlayton@kernel.org> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jeff Layton --- net/ceph/cls_lock_client.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/ceph/cls_lock_client.c b/net/ceph/cls_lock_client.c index 4cc28541281b..b1d12bf4b83e 100644 --- a/net/ceph/cls_lock_client.c +++ b/net/ceph/cls_lock_client.c @@ -264,8 +264,11 @@ static int decode_locker(void **p, void *end, struct ceph_locker *locker) return ret; *p += sizeof(struct ceph_timespec); /* skip expiration */ - ceph_decode_copy(p, &locker->info.addr, sizeof(locker->info.addr)); - ceph_decode_addr(&locker->info.addr); + + ret = ceph_decode_entity_addr(p, end, &locker->info.addr); + if (ret) + return ret; + len = ceph_decode_32(p); *p += len; /* skip description */ From patchwork Wed Jun 5 13:11:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10976959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6797792A for ; Wed, 5 Jun 2019 13:11:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 588F12861D for ; Wed, 5 Jun 2019 13:11:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 572BD28984; Wed, 5 Jun 2019 13:11:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10DF628724 for ; Wed, 5 Jun 2019 13:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728029AbfFENLO (ORCPT ); Wed, 5 Jun 2019 09:11:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:59480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728023AbfFENLL (ORCPT ); Wed, 5 Jun 2019 09:11:11 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8542220717; Wed, 5 Jun 2019 13:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559740271; bh=ExoCL8j1cJBg9m+SRiqG77O6/27vctei/f3S/6UsoOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AM0F7rzDxC/QDIq7ECq3TGoTxceWt6HZ4DdtrksRNsJ9hq/uGZm+1X/YlvQz+WRuw ZkpkWLXTmWgj9KJOw4gVEeNN4fANdhlSDeqIgEBsIR3kENXplbLb6Tex874yRdNQX3 xV5L5/8Jswi3C3ZdTLfGjqoJmpdyxUv9EoCcE7ro= From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: idryomov@redhat.com, zyan@redhat.com, sage@redhat.com Subject: [RFC PATCH 9/9] libceph: turn on CEPH_FEATURE_MSG_ADDR2 Date: Wed, 5 Jun 2019 09:11:02 -0400 Message-Id: <20190605131102.13529-10-jlayton@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190605131102.13529-1-jlayton@kernel.org> References: <20190605131102.13529-1-jlayton@kernel.org> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that the client can handle either address formatting, advertise to the peer that we can support it. Signed-off-by: Jeff Layton --- include/linux/ceph/ceph_features.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index 65a38c4a02a1..39e6f4c57580 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h @@ -211,6 +211,7 @@ DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facin CEPH_FEATURE_MON_STATEFUL_SUB | \ CEPH_FEATURE_CRUSH_TUNABLES5 | \ CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \ + CEPH_FEATURE_MSG_ADDR2 | \ CEPH_FEATURE_CEPHX_V2) #define CEPH_FEATURES_REQUIRED_DEFAULT 0