From patchwork Tue Jan 22 22:30:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2021191 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 51B3BDF2EB for ; Tue, 22 Jan 2013 22:31:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753380Ab3AVWbF (ORCPT ); Tue, 22 Jan 2013 17:31:05 -0500 Received: from mail-ie0-f172.google.com ([209.85.223.172]:55168 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753190Ab3AVWbD (ORCPT ); Tue, 22 Jan 2013 17:31:03 -0500 Received: by mail-ie0-f172.google.com with SMTP id c13so12674414ieb.3 for ; Tue, 22 Jan 2013 14:31:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=wAo2iwhFyytFrw6VQfQbTsdww/AqEMP9fu3xq7teHZA=; b=deMft/bRyjhmweSt9qkPE67OowtcY/Pt90Rgr0NSAhYelDeqbMpxYael68WevAzbtj A3OruNVXbiXvrH6/ZAqpuLdF6ZAm6PgbAbfxax6Jb+TGhlxKn2MwsAW1i6+t5GceiO1h ybkH5OUIa4lK8yMFQa5vIkFv1uFUlH59l5O9E5yKmf3g6cfnaB3hKpxC86NWrJl/shmz DUmBpMSx0D242ExNEuaxYTAn5VAeybGyx0hgqO1SMrOfUemKp1u7VR3puUDQdgipgRZh CnW+RvzfkfQZ49rHPpAb7/TnO6tIEZIa5IFyCnYSF9B3RfUt84sGYNCvPCRQEWxMk8C3 HWvg== X-Received: by 10.50.150.174 with SMTP id uj14mr12966107igb.19.1358893862450; Tue, 22 Jan 2013 14:31:02 -0800 (PST) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id l8sm12961310igo.13.2013.01.22.14.31.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jan 2013 14:31:01 -0800 (PST) Message-ID: <50FF1323.20208@inktank.com> Date: Tue, 22 Jan 2013 16:30:59 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH 10/12] rbd: send notify ack asynchronously References: <50FF11EA.3000808@inktank.com> In-Reply-To: <50FF11EA.3000808@inktank.com> X-Gm-Message-State: ALoCoQnLjBAAgra0w/C5LslR5B/ZkCgKhF9DPZc0oA3OvZSOhk8Cq3xN6wQvY7cpCzMMU57waSPk Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org When we receive notification of a change to an rbd image's header object we need to refresh our information about the image (its size and snapshot context). Once we have refreshed our rbd image we need to acknowledge the notification. This acknowledgement was previously done synchronously, but there's really no need to wait for it to complete. Change it so the caller doesn't wait for the notify acknowledgement request to complete. And change the name to reflect it's no longer synchronous. This resolves: http://tracker.newdream.net/issues/3877 Signed-off-by: Alex Elder --- drivers/block/rbd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) struct rbd_obj_request *obj_request; @@ -1799,11 +1799,11 @@ static int rbd_obj_notify_ack_sync(struct rbd_device *rbd_dev, goto out_err; osdc = &rbd_dev->rbd_client->client->osdc; + obj_request->callback = rbd_obj_request_put; ret = rbd_obj_request_submit(osdc, obj_request); - if (!ret) - ret = rbd_obj_request_wait(obj_request); out_err: - rbd_obj_request_put(obj_request); + if (ret) + rbd_obj_request_put(obj_request); return ret; } @@ -1825,7 +1825,7 @@ static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, void *data) rbd_warn(rbd_dev, "got notification but failed to " " update snaps: %d\n", rc); - rbd_obj_notify_ack_sync(rbd_dev, hver, notify_id); + rbd_obj_notify_ack(rbd_dev, hver, notify_id); } /* diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index a6ca5db..e66695a 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1775,7 +1775,7 @@ static int rbd_image_request_submit(struct rbd_image_request *image_request) return ret; } -static int rbd_obj_notify_ack_sync(struct rbd_device *rbd_dev, +static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, u64 ver, u64 notify_id) {