From patchwork Thu Nov 14 10:57:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 11243537 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 977B8930 for ; Thu, 14 Nov 2019 10:57:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D4D820709 for ; Thu, 14 Nov 2019 10:57:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbfKNK54 (ORCPT ); Thu, 14 Nov 2019 05:57:56 -0500 Received: from mx2.suse.de ([195.135.220.15]:33340 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726923AbfKNK5l (ORCPT ); Thu, 14 Nov 2019 05:57:41 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 014F4AD07; Thu, 14 Nov 2019 10:57:40 +0000 (UTC) From: Luis Henriques To: Jeff Layton , Sage Weil , Ilya Dryomov , "Yan, Zheng" Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Henriques Subject: [RFC PATCH v2 2/4] ceph: get the require_osd_release field from the osdmap Date: Thu, 14 Nov 2019 10:57:34 +0000 Message-Id: <20191114105736.8636-3-lhenriques@suse.com> In-Reply-To: <20191114105736.8636-1-lhenriques@suse.com> References: <20191114105736.8636-1-lhenriques@suse.com> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Since Ceph Octopus, OSDs are encoding require_osd_release into the client data part of the osdmap. This patch adds code to pick this extra field. Signed-off-by: Luis Henriques --- include/linux/ceph/ceph_features.h | 10 ++++++++-- include/linux/ceph/osdmap.h | 1 + net/ceph/osdmap.c | 21 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index 39e6f4c57580..f329d1907dd7 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h @@ -9,6 +9,7 @@ */ #define CEPH_FEATURE_INCARNATION_1 (0ull) #define CEPH_FEATURE_INCARNATION_2 (1ull<<57) // CEPH_FEATURE_SERVER_JEWEL +#define CEPH_FEATURE_INCARNATION_3 ((1ull<<57)|(1ull<<28)) // SERVER_MIMIC #define DEFINE_CEPH_FEATURE(bit, incarnation, name) \ static const uint64_t CEPH_FEATURE_##name = (1ULL<pg_upmap_items)); } + if (struct_v >= 6) + /* crush version */ + ceph_decode_skip_32(p, end, e_inval); + if (struct_v >= 7) { + /* + * skip removed_snaps and purged_snaps + * (snap_interval_set_t = 8 + 8) + */ + ceph_decode_skip_set(p, end, 16, e_inval); + ceph_decode_skip_set(p, end, 16, e_inval); + } + if (struct_v >= 9) { + struct ceph_timespec ts; + + /* last_up_change and last_in_change */ + ceph_decode_copy_safe(p, end, &ts, sizeof(ts), e_inval); + ceph_decode_copy_safe(p, end, &ts, sizeof(ts), e_inval); + } + if (struct_v >= 10) + ceph_decode_8_safe(p, end, map->require_osd_release, e_inval); + /* ignore the rest */ *p = end;