From patchwork Mon Sep 19 17:03:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 9339917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0CE43607D0 for ; Mon, 19 Sep 2016 17:03:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEA96295C7 for ; Mon, 19 Sep 2016 17:03:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2CD2295D4; Mon, 19 Sep 2016 17:03:51 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 710F6295C9 for ; Mon, 19 Sep 2016 17:03:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752462AbcISRDs (ORCPT ); Mon, 19 Sep 2016 13:03:48 -0400 Received: from mail-yw0-f195.google.com ([209.85.161.195]:33666 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752436AbcISRDr (ORCPT ); Mon, 19 Sep 2016 13:03:47 -0400 Received: by mail-yw0-f195.google.com with SMTP id g192so8608262ywh.0 for ; Mon, 19 Sep 2016 10:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4qs5BMJdkiMCXCS5RdJK7CJG111hwmMlq/V80wiVJ3Q=; b=W+V2g8HhY+QCaxSyf+2o5S0syfjKhKNfASE1r5YhId812T+GN11Zz3riMh24woyz5I RFIuO0DxSTJlT26pDCiEOr1ok5CxD20tr8QB/ssnP/K4vKoo72Za/NI0oD9D6vH2s4FF WZO93mWTvdiYTN6MxC0VfubYY6wEe8i0ZQIkhVj48zUSONk3ISbJkwT+Tjg/AT9BxgiF rjgQJZDeFT2o280+FxBmkro94wM/ej7Tmg78qAxOsNxOu1k8wjb66ich6gUf7S+xSmHp sFRfz6KC4jROUl8i5SODIWbtpUPleDOqKUozW87XX/ucgl59ddd0en4MZzsn9xNUw6MO XlNg== 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:in-reply-to :references; bh=4qs5BMJdkiMCXCS5RdJK7CJG111hwmMlq/V80wiVJ3Q=; b=UxUXkf6NMB4wdDgvypCS5A8RWzPQ0mJ2mPucqTCWQQPyYXXxQpoojgj9ENB3zCqxWG eMPDYZUp/NnAAd9w6h12Z1mrst0qCKFXd2I40iYnOe3Cohr1po+NeyOi6Mtec+54QJUV 05mGrqf1koUUoe09qyn3kNciGCExh8WmawxZrw5VaEEDIyOhEfIrswHh9BMql2Ya9HT7 UFsG6QVmUYL0KtDx0RKBzIJCxSFK46qEoq13LvI1rjGowK8qaY/8qboNYuNgtfxdTB6H o7PcnSbKHTY4fKb3ujGamC87iMiOU71RXLJQ7g4Rd6Uo6dcgzt+kcFyR6YIWoVX9L1wk XWWg== X-Gm-Message-State: AE9vXwP5oYco4Q0xQ+AJmzfzO5/plf2dL9uBacbBlxsmyNk46DlFgLoIO/fUGVpleRU1Xw== X-Received: by 10.129.114.8 with SMTP id n8mr19634187ywc.332.1474304626333; Mon, 19 Sep 2016 10:03:46 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id o14sm9773905ywd.3.2016.09.19.10.03.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Sep 2016 10:03:45 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Alex Elder Subject: [PATCH 3/8] rbd: mark the original request as done if stat request fails Date: Mon, 19 Sep 2016 19:03:23 +0200 Message-Id: <1474304608-17958-4-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1474304608-17958-1-git-send-email-idryomov@gmail.com> References: <1474304608-17958-1-git-send-email-idryomov@gmail.com> 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 If stat request fails with something other than -ENOENT (which just means that we need to copyup), the original object request is never marked as done and therefore never completed. Fix this by moving the mark done + complete snippet from rbd_img_obj_parent_read_full() into rbd_img_obj_exists_callback(). The former remains covered, as the latter is its only caller (through rbd_img_obj_request_submit()). Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder --- drivers/block/rbd.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 027e0817a118..b247200a0f28 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2805,10 +2805,6 @@ out_err: ceph_release_page_vector(pages, page_count); if (parent_request) rbd_img_request_put(parent_request); - obj_request->result = result; - obj_request->xferred = 0; - obj_request_done_set(obj_request); - return result; } @@ -2860,19 +2856,25 @@ static void rbd_img_obj_exists_callback(struct rbd_obj_request *obj_request) obj_request_existence_set(orig_request, true); } else if (result == -ENOENT) { obj_request_existence_set(orig_request, false); - } else if (result) { - orig_request->result = result; - goto out; + } else { + goto fail_orig_request; } /* * Resubmit the original request now that we have recorded * whether the target object exists. */ - orig_request->result = rbd_img_obj_request_submit(orig_request); -out: - if (orig_request->result) - rbd_obj_request_complete(orig_request); + result = rbd_img_obj_request_submit(orig_request); + if (result) + goto fail_orig_request; + + return; + +fail_orig_request: + orig_request->result = result; + orig_request->xferred = 0; + obj_request_done_set(orig_request); + rbd_obj_request_complete(orig_request); } static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)