From patchwork Thu May 16 21:29:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2580491 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 541A14020A for ; Thu, 16 May 2013 21:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754170Ab3EPV3Y (ORCPT ); Thu, 16 May 2013 17:29:24 -0400 Received: from mail-oa0-f50.google.com ([209.85.219.50]:56522 "EHLO mail-oa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628Ab3EPV3Y (ORCPT ); Thu, 16 May 2013 17:29:24 -0400 Received: by mail-oa0-f50.google.com with SMTP id l20so4412458oag.9 for ; Thu, 16 May 2013 14:29:23 -0700 (PDT) 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=qot2NoBnhHvQtYCO+AwSAqjaodEyo91Ll/34ijKE7RE=; b=V4bhkk9kqmuv2dOugihsSozG2pVzHaVhF5yMgT/T8OmQi2r3eSM0Qio1DC2qTEia6A 3Aub3sBYAVMzopvgJOuSCi3YlH/sB5d0fNH5G8KfoMQyy28O8BSUqWC/osU4qh+f/7zX CvrmlYxxaJZ0/IYq5xF3V6IIgmHJUuHCI+fAf7Qv9ZIkJWZ39j9gjWHTlhxJVJdPoAWd fbm8YD5tbTI63gPbG4jWv9op6IpEk08Kb2WF622JZIUvrFtbO3h02/RmOd0bi+Zj96oL i3pRyBo39LeZQIPtyG60N/4OdBmlp+roKBIpKrP9Ry27EipWvb8RHJ9L7GaIBVhN9wpg 4IHw== X-Received: by 10.182.219.136 with SMTP id po8mr20502145obc.75.1368739763495; Thu, 16 May 2013 14:29:23 -0700 (PDT) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id x10sm9093208oes.6.2013.05.16.14.29.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 May 2013 14:29:22 -0700 (PDT) Message-ID: <51954FB1.9060902@inktank.com> Date: Thu, 16 May 2013 16:29:21 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH, v2] rbd: drop original request earlier for existence check References: <519195DC.1060609@inktank.com> In-Reply-To: <519195DC.1060609@inktank.com> X-Gm-Message-State: ALoCoQnO7B6IfkdOHRH2owi+VJL+3sPF8zSZRBKNKppTJ+OBlxC00HNwxwXgLDYJSotWMSNsw5fX Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org The reference to the original request dropped at the end of rbd_img_obj_exists_callback() corresponds to the reference taken in rbd_img_obj_exists_submit() to account for the stat request referring to it. Move the put of that reference up right after clearing that pointer to make its purpose more obvious. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- v2: rebased to reflect changes in earlier patches drivers/block/rbd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) @@ -2549,7 +2550,6 @@ static void rbd_img_obj_exists_callback(struct rbd_obj_request *obj_request) if (!rbd_dev->parent_overlap) { struct ceph_osd_client *osdc; - rbd_obj_request_put(orig_request); osdc = &rbd_dev->rbd_client->client->osdc; result = rbd_obj_request_submit(osdc, orig_request); if (!result) @@ -2579,7 +2579,6 @@ static void rbd_img_obj_exists_callback(struct rbd_obj_request *obj_request) out: if (orig_request->result) rbd_obj_request_complete(orig_request); - rbd_obj_request_put(orig_request); } static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index fdbcf04..b4c5e47 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2529,6 +2529,7 @@ static void rbd_img_obj_exists_callback(struct rbd_obj_request *obj_request) */ orig_request = obj_request->obj_request; obj_request->obj_request = NULL; + rbd_obj_request_put(orig_request); rbd_assert(orig_request); rbd_assert(orig_request->img_request);