From patchwork Wed May 8 22:07:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2541921 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 C94CD3FC5A for ; Wed, 8 May 2013 22:07:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752012Ab3EHWHo (ORCPT ); Wed, 8 May 2013 18:07:44 -0400 Received: from mail-ob0-f170.google.com ([209.85.214.170]:43125 "EHLO mail-ob0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774Ab3EHWHo (ORCPT ); Wed, 8 May 2013 18:07:44 -0400 Received: by mail-ob0-f170.google.com with SMTP id er7so895960obc.1 for ; Wed, 08 May 2013 15:07:43 -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=7JlvrmjqnRWdZqzBHN4WT5D3BiWHk73f1ZZHWUGJ/ts=; b=JgOxl3N7ZflnubJhq003mnXa7ymXRta9yAtS/spJeAKDJD4zKzgqprl9Ecwk5k/8Zc 89UiHrQtpEoieKYlldVX/PaVTSlUQIrv2jD4NrRSY5pjTILmV6GyEri1zDM7wbzwwNVW RdMscTvN4Ov8+XkCIOzURJTQAkK/UlYvHgWYy1z6p1Tj/EMRfnBfxi25zO+oEWJ2TvR1 bf/QS5GBCqW5XP58kgRy0f0dh90Jex3XcNGxFdVZZFlMOpFgq6TPkT3Yht5zND7oWoh/ ETTInE4IP9rFdDGJpZ0sOItjz03Jd+sxuA7sRxMDSalwQd1mGG+WvhJgUbiJdJ29fq3W cU5Q== X-Received: by 10.60.131.104 with SMTP id ol8mr2742693oeb.104.1368050863606; Wed, 08 May 2013 15:07:43 -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 nt17sm242494obb.13.2013.05.08.15.07.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 May 2013 15:07:42 -0700 (PDT) Message-ID: <518ACCAE.4050600@inktank.com> Date: Wed, 08 May 2013 17:07:42 -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 1/5] rbd: fix an incorrect assertion condition References: <518ACC55.7090100@inktank.com> In-Reply-To: <518ACC55.7090100@inktank.com> X-Gm-Message-State: ALoCoQkvlzU2b/+xvkechP4fRLjeqcp0aW6/2LbUqg5H+iT92sK8MnAPg/J7eD/WVS2Wz/isf7Me Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org In rbd_img_obj_parent_read_full_callback() there is an assertion intended to verify the size of the image request for a full parent read was the size of the original request's target object. But assertion was looking at the parent image order rather than the original one, and these values can differ. Fix that. This resolves: http://tracker.ceph.com/issues/4938 Signed-off-by: Alex Elder --- drivers/block/rbd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 0d874a5..15ac2a5 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2186,13 +2186,13 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request) result = img_request->result; obj_size = img_request->length; xferred = img_request->xferred; + rbd_img_request_put(img_request); - rbd_dev = img_request->rbd_dev; + rbd_assert(orig_request->img_request); + rbd_dev = orig_request->img_request->rbd_dev; rbd_assert(rbd_dev); rbd_assert(obj_size == (u64)1 << rbd_dev->header.obj_order); - rbd_img_request_put(img_request); - if (result) goto out_err;