From patchwork Thu Feb 4 12:12:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 8220451 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 024AE9F3CD for ; Thu, 4 Feb 2016 12:12:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B91B202F8 for ; Thu, 4 Feb 2016 12:12:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 243F7202F2 for ; Thu, 4 Feb 2016 12:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751133AbcBDMMe (ORCPT ); Thu, 4 Feb 2016 07:12:34 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:34446 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750798AbcBDMMd (ORCPT ); Thu, 4 Feb 2016 07:12:33 -0500 Received: by mail-wm0-f46.google.com with SMTP id 128so24034544wmz.1 for ; Thu, 04 Feb 2016 04:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=/Z/zUoGXvcfTNLKZ761kCeekAO/VvfhO9HDJqMN4eMg=; b=mYw81ixWL735eojzyGEVd20rqBGvxayivllWHkiYHeKsYAaSfIOM4jKcVCMLw1p56X 23YXz8k0tyRNW5Gi2t7b/f7f0mujtEfZjwLoBiR+uJkH8ePXzczUn2Hm8aatDX4riwl5 ubuBY16/govDaHwadKg4Ygk6pj1+Mi2TJ2SounjPlSyvovZDCCqDnTSSQF1nupkO7I8V CNzgKHQVILGbUQWkU9btWnFoJH57AZvdfxnmPI9rSe22iYWzIvbzdZmF+N81TVpTesv/ HjJ1wOxLGosKy+oX9d/9xZiRGlajI0rXla5PQGEgGf7fH1WiEL+OT/UXAdLbjwXy4DiH R8AA== 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=/Z/zUoGXvcfTNLKZ761kCeekAO/VvfhO9HDJqMN4eMg=; b=gfBIOtLmLDvlaTOaOaZSWapRnLxa0ht5QluetZEV1rkR/5GQBhsgn5x17BericglxJ SYn+V3K29dS2AJ8KqHTMZS6qkpu4UjjHM0qAzmOfkWw9uwLeBtSBbtjYY2Q6mpG1Zb8t 2H37v6wfmmdRc4L5fmMruGt7FIj8fnx2Dc9i75b79DOLzR2tSkP7pZjIIeZ6Wmg/falY b/aS1/+gIqP6q6uVCXNQmBCRueATKJtR83spbiQSjZyyS6dwrA8Iou/NyQo9DrnmwVlK CGsjQPGC+8r13V4eaIEibyNOBiwmNzE8+P8I/r9A1HlD3wJ8qUDqErug7nyL41PNvpiF Hw4Q== X-Gm-Message-State: AG10YOR2bIWlUp/25Yd0FGclVHfJKW9Pcb4sCGBySXZTSwarNXZFysCKXIJxqPnk614dvg== X-Received: by 10.28.238.144 with SMTP id j16mr9534604wmi.43.1454587951994; Thu, 04 Feb 2016 04:12:31 -0800 (PST) Received: from localhost.localdomain.com (ip-78-102-114-179.net.upcbroadband.cz. [78.102.114.179]) by smtp.gmail.com with ESMTPSA id z127sm26031409wme.2.2016.02.04.04.12.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Feb 2016 04:12:31 -0800 (PST) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Sage Weil Subject: [PATCH] libceph: MOSDOpReply v7 encoding Date: Thu, 4 Feb 2016 13:12:17 +0100 Message-Id: <1454587937-27996-1-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 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.2 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 Empty request_redirect_t (struct ceph_request_redirect in the kernel client) is now encoded with a bool. NEW_OSDOPREPLY_ENCODING feature bit overlaps with already supported CRUSH_TUNABLES5. Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil --- include/linux/ceph/ceph_features.h | 5 ++++- net/ceph/osd_client.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index 6b4b059c158f..d2d78861c30a 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h @@ -73,6 +73,8 @@ #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 @@ -120,7 +122,8 @@ 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_CRUSH_TUNABLES5 | \ + CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING) #define CEPH_FEATURES_REQUIRED_DEFAULT \ (CEPH_FEATURE_NOSRCADDR | \ diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 95d7443943fc..fb9da42eae98 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1814,6 +1814,7 @@ 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); @@ -1885,6 +1886,15 @@ 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;