From patchwork Tue Jun 16 07:44:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 11606729 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 E6A7514DD for ; Tue, 16 Jun 2020 07:44:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC62C2078E for ; Tue, 16 Jun 2020 07:44:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VRuZ+0wq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727077AbgFPHoq (ORCPT ); Tue, 16 Jun 2020 03:44:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726573AbgFPHop (ORCPT ); Tue, 16 Jun 2020 03:44:45 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE11FC03E96A for ; Tue, 16 Jun 2020 00:44:44 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id q19so20424023eja.7 for ; Tue, 16 Jun 2020 00:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B3M12iSdXWBB2adXOGU1Q0ONg9Z40Dwvb8wg1O/wB6E=; b=VRuZ+0wqcyw+9y8TlV2NaoALFqRmkJEMzsHDU8X5lIHVgXhYtJOXy/v0KlFVLLDP1M 6DwVqAOuq3YkNFzAMi6xn2KLpeBR6qp0A92WCSciAj+nWO7IXCIPLybvY5fQDLA9aoWE iKqsknwse0NAUaQUof5tT3828DYfzyvTjaLPrjFrU7kzv39o8Jsy7KuTnQyoLWh7mD7N 8v2rsN0fqSOUEwlPVC2XGMLzMEykw3NlKcFkdrjfYfXqLLE1OiopjgVGl6TFhLIZc2jm m/fPsj3DYInadhjmMppCCdPELPcx1UIpot8wmm7QvpMZPhBNuVulcf4ZFr79lh/8ghTn g6Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B3M12iSdXWBB2adXOGU1Q0ONg9Z40Dwvb8wg1O/wB6E=; b=MmAEY8ssdFEYyf0ZRjQEeHqwb3tgtZXUHBaKMebI5FXN85G5pm5KuZqTIAyqbZiBX/ q70Ew6WfC4jt29gyoaCeHwZCKQN15Cyz4t8q+ZzsXQJJU8eaqZZ62OLrlQLn8aUhWSPa jVNReoAy1aCbHjEMJ1AW0rYosj3T4mAPOvMM4WM+LP50mALKKLFWVPxUNJweTYuwVVfq OmhJg2YPBg0AXvJt825ooyk8YY1xBpAOSTrJyGMw3O0pLarU0KaDaSGSE44nEbid2Dy2 Dzt0JwUHljvpuzx/X2aljiVHmTHEzopzMsrMxJovQrOjq9fcfqaU1j5eF08As9oFn7hw KTJA== X-Gm-Message-State: AOAM533Kmme+bybzlWjN4HiHow+wX2GxE2vHS3yL7hEMpMhop/5/1cIM VNtcRycXeWXqfxrwDe4QGg/YPx8epRA= X-Google-Smtp-Source: ABdhPJxICLfKS6+LIsndMa2tOiJcrT5vkLi0CZHqHimd0DrzQZtdoXSufM+VG4MHyXTxndwvcH1MqA== X-Received: by 2002:a17:906:3a43:: with SMTP id a3mr1502569ejf.121.1592293483025; Tue, 16 Jun 2020 00:44:43 -0700 (PDT) Received: from kwango.local (ip-94-112-129-237.net.upcbroadband.cz. [94.112.129.237]) by smtp.gmail.com with ESMTPSA id j2sm9684562edn.30.2020.06.16.00.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 00:44:42 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Jeff Layton Subject: [PATCH 1/3] libceph: don't omit recovery_deletes in target_copy() Date: Tue, 16 Jun 2020 09:44:13 +0200 Message-Id: <20200616074415.9989-2-idryomov@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20200616074415.9989-1-idryomov@gmail.com> References: <20200616074415.9989-1-idryomov@gmail.com> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Currently target_copy() is used only for sending linger pings, so this doesn't come up, but generally omitting recovery_deletes can result in unneeded resends (force_resend in calc_target()). Fixes: ae78dd8139ce ("libceph: make RECOVERY_DELETES feature create a new interval") Signed-off-by: Ilya Dryomov --- net/ceph/osd_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index a37d159019a0..8f7fbe861dff 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -445,6 +445,7 @@ static void target_copy(struct ceph_osd_request_target *dest, dest->size = src->size; dest->min_size = src->min_size; dest->sort_bitwise = src->sort_bitwise; + dest->recovery_deletes = src->recovery_deletes; dest->flags = src->flags; dest->paused = src->paused; From patchwork Tue Jun 16 07:44:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 11606735 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 97ACF14E3 for ; Tue, 16 Jun 2020 07:44:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 812BB207BC for ; Tue, 16 Jun 2020 07:44:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rOm2OHnt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727110AbgFPHot (ORCPT ); Tue, 16 Jun 2020 03:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbgFPHos (ORCPT ); Tue, 16 Jun 2020 03:44:48 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51498C05BD43 for ; Tue, 16 Jun 2020 00:44:45 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id p20so20379817ejd.13 for ; Tue, 16 Jun 2020 00:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a/P8QTJOjKVdkx3hKO16CUTO3uzcZ4IlulK2ctEy8mI=; b=rOm2OHntY9tRBjf+WwgU9alskE8Unmtf2/oXbROZJKat86x4KTAhvcdvXgzxz4C0ci g3NAZt77LmW6INl+9fg19Uy+YKdboHBMCAxEG9UB89TT72VjIPP49Uz/PnxCE8hbW57Q kCO1/w/1d+6c915irEfG9BBEFdoRCNh5u9t1C3fMNZLtJjJMO5JHz+O22O3Glq1jq2cq nDaAdZcgfNb1tKLbx9xx1RMeH3+COMWGO5mu0WsAMSiinrrTUjah3kCDktAWb72BipQD hmQ7WAlh/pYTECfI1gF+7mVkM/6G+7ZfV3C64AkqK7w1QIloiMsiH5E4yEpSCqEw3zaQ EWow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a/P8QTJOjKVdkx3hKO16CUTO3uzcZ4IlulK2ctEy8mI=; b=fubcOBzo67imggDYk5nHV2NYVp8AkSPKbwLmhGQUA3C54xvGLNqUPad7+cEkvyH/jy xONKVLVX4z2C+YgokpUAV889sSkibfvKnnJ8D3tqTKEVCgnTWEw+sHEkabXSSec1pScj 9NElx/gDUOyufAqeDCbGXUf0Z/5BDlKKAjKTXYf73Aee/l7O5R8YvjR4MyLGlz/WEJvU +N0Wbzjn/tOJaHHu+VijHstNbBUWLW0SCw2ULVIHeceunpU35zozLnvmWgyu5aVbNq7D npMJl8qf0TLg5tp9+K5Hhen84GHxN9QcN3fz/2A0NqfB9UG56kKKyJEtffkDhLrg71nq 2Tww== X-Gm-Message-State: AOAM531oOgrGs9Clu9F2NDpiiGtycK25ycMU+/KqV/FUcbCo8KzDxjjy Wdu+vb35MdIC8JS9DV+OZRbpZd5a2xE= X-Google-Smtp-Source: ABdhPJwDc/G7P4y0hRhyOT9Fumz0I7/TqcwaHq0ClBAPbZGUMlRTtvFlsyUoAeBrJ+qO7kl+Zfo8vg== X-Received: by 2002:a17:907:33ce:: with SMTP id zk14mr1568011ejb.2.1592293484050; Tue, 16 Jun 2020 00:44:44 -0700 (PDT) Received: from kwango.local (ip-94-112-129-237.net.upcbroadband.cz. [94.112.129.237]) by smtp.gmail.com with ESMTPSA id j2sm9684562edn.30.2020.06.16.00.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 00:44:43 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Jeff Layton Subject: [PATCH 2/3] libceph: don't omit used_replica in target_copy() Date: Tue, 16 Jun 2020 09:44:14 +0200 Message-Id: <20200616074415.9989-3-idryomov@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20200616074415.9989-1-idryomov@gmail.com> References: <20200616074415.9989-1-idryomov@gmail.com> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Currently target_copy() is used only for sending linger pings, so this doesn't come up, but generally omitting used_replica can hang the client as we wouldn't notice the acting set change (legacy_change in calc_target()) or trigger a warning in handle_reply(). Fixes: 117d96a04f00 ("libceph: support for balanced and localized reads") Signed-off-by: Ilya Dryomov --- net/ceph/osd_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 8f7fbe861dff..2db8b44e70c2 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -448,6 +448,7 @@ static void target_copy(struct ceph_osd_request_target *dest, dest->recovery_deletes = src->recovery_deletes; dest->flags = src->flags; + dest->used_replica = src->used_replica; dest->paused = src->paused; dest->epoch = src->epoch; From patchwork Tue Jun 16 07:44:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 11606733 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 24E5014DD for ; Tue, 16 Jun 2020 07:44:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E7ED207BC for ; Tue, 16 Jun 2020 07:44:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U7vmVd9s" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbgFPHot (ORCPT ); Tue, 16 Jun 2020 03:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727090AbgFPHos (ORCPT ); Tue, 16 Jun 2020 03:44:48 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E1E2C03E96A for ; Tue, 16 Jun 2020 00:44:46 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id y6so8247908edi.3 for ; Tue, 16 Jun 2020 00:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZbM1RYndbIseJODt2duRRRs16tKrRP5ZgVNKGiZJAV0=; b=U7vmVd9saIpqvVJY7ya3F1goaOX6pdQg0sREJfndexeZAilitffFHEBtcpK18F6UVj M/jLmBcaMsPEbCcFGZG8kg84yCijeZHLqfT4gZoF3l/zjFTx3ke1HtnWFVAUHTSJ0Doy TP+gRYxtgcyyLEfj2mqGxMUb1jBFm4WL9ya0VMK/CwevpSZG2VyGGR7QObCjVPQdwCLc nNLmixEQoZS/8KaSKI87SSEg/WofNU3T051b2nVQ0Kba0vFIlqjtcQrJC/cfNG68O+7s aIc3CWxlKDTgHk7oLRoDIPmYpXzkHsAh4LgWf+ia2QA5YRdRQTjiyDqSsEQuB+Y9NE4+ bXtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZbM1RYndbIseJODt2duRRRs16tKrRP5ZgVNKGiZJAV0=; b=pvqEWTPKgSP9y2AzFFLyk22H2Vxb8kgeUUuiws6cHUuHtdKCR0f5uvfaBl0KneF+4a IKGdzU/Lvk7qNLE1d9fZZ4kFkQ2hCargCgxTFfTuOchmuqjr/zdc4CvLrT1XJRKf9ZZh LvSnDgyMhJlEJcVsrQ1aePiVQgkPFlHDg2crdEMp+feAVixkvsPyT8A+zAU0P4/Wsg2X /Swk8yHSxd39rNSnYpxdNvBPvXfVceLgynZDL79rcJkq9flV+gfjJXzrsOa5090Pinam v9JufD0z8gfbhQL5Y0YqU34S2pZS2mObdikISVfMe7VFhL7wA8p1M3c6Q510HEmyib/h Cj3Q== X-Gm-Message-State: AOAM531eAWcf1dXc2aDWM273Lyk32cYdLq9XJs3GzzrIusEvibyBKNhj DLz7QOX5sCCp4Q7BYpYsrh1GWuf2Gic= X-Google-Smtp-Source: ABdhPJyjr8Qymw7tvDb5XyETBT0X3ctql5uj1nTyGW/ImAobNd/cVcfD30K7AcmlF+UubVfiAczerw== X-Received: by 2002:a05:6402:6c6:: with SMTP id n6mr1322242edy.277.1592293484896; Tue, 16 Jun 2020 00:44:44 -0700 (PDT) Received: from kwango.local (ip-94-112-129-237.net.upcbroadband.cz. [94.112.129.237]) by smtp.gmail.com with ESMTPSA id j2sm9684562edn.30.2020.06.16.00.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 00:44:44 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Jeff Layton Subject: [PATCH 3/3] libceph: use target_copy() in send_linger() Date: Tue, 16 Jun 2020 09:44:15 +0200 Message-Id: <20200616074415.9989-4-idryomov@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20200616074415.9989-1-idryomov@gmail.com> References: <20200616074415.9989-1-idryomov@gmail.com> MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Instead of copying just oloc, oid and flags, copy the entire linger target. This is more for consistency than anything else, as send_linger() -> submit_request() -> __submit_request() sends the request regardless of what calc_target() says (i.e. both on CALC_TARGET_NO_ACTION and CALC_TARGET_NEED_RESEND). Signed-off-by: Ilya Dryomov --- net/ceph/osd_client.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 2db8b44e70c2..db6abb5a5511 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -3076,9 +3076,7 @@ static void send_linger(struct ceph_osd_linger_request *lreq) cancel_linger_request(req); request_reinit(req); - ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); - ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); - req->r_flags = lreq->t.flags; + target_copy(&req->r_t, &lreq->t); req->r_mtime = lreq->mtime; mutex_lock(&lreq->lock);