From patchwork Sat Mar 9 16:03:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2241851 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 E12C3DF2F2 for ; Sat, 9 Mar 2013 16:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932762Ab3CIQDx (ORCPT ); Sat, 9 Mar 2013 11:03:53 -0500 Received: from mail-ia0-f182.google.com ([209.85.210.182]:37255 "EHLO mail-ia0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932401Ab3CIQDw (ORCPT ); Sat, 9 Mar 2013 11:03:52 -0500 Received: by mail-ia0-f182.google.com with SMTP id b35so627424iac.13 for ; Sat, 09 Mar 2013 08:03:52 -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=QzAIys/9KT1DCFgxTakPB45vODPJG7JdujcxXtkj0OU=; b=Xeg4GTlrIc8pCaC8/Hxk7/le7iQAs4elIYy5eAUAKroV/JviOqZwS0h8IfwDi0koeG QVVxNcaoXZHXJHhR5BtbBhkLrgthc9PEil8NVO2aum18LaOE7752bL/4Ays8+FZLTwQ8 0dM+mOloi+1HoxWfsliVpv9TQp5/HBr/nT97wstjV53C7UnfGKGCObfDJVH53msw8Iw2 GPMp+H9VUdzKCMeL+rQbq+w/zJynE5whLQo8FHBbc6piJwDQK+2z8oZHuBX0OLBb+2/x DSMcQ1bX9tXgCzhgeXhhNhGEtZ8/zMZWbBHv0H+m4KQ7FsJQIKGeWESF/YbmTxKh81Gg fAlQ== X-Received: by 10.50.88.168 with SMTP id bh8mr2628974igb.67.1362845032336; Sat, 09 Mar 2013 08:03:52 -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 uy13sm4678815igb.7.2013.03.09.08.03.50 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 Mar 2013 08:03:51 -0800 (PST) Message-ID: <513B5D66.3000605@inktank.com> Date: Sat, 09 Mar 2013 10:03:50 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 7/7] libceph: activate message data assignment checks References: <513B5CAF.4010702@inktank.com> In-Reply-To: <513B5CAF.4010702@inktank.com> X-Gm-Message-State: ALoCoQmEtBWGJzTzv3uSsz28ZFC7By1uzjO35SnkF9Qswr63IE/rG6dpkJY08kIXvNlTjmo9Lr6n Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org The mds client no longer tries to assign zero-length message data, and the osd client no longer sets its data info more than once. This allows us to activate assertions in the messenger to verify these things never happen. This resolves both of these: http://tracker.ceph.com/issues/4263 http://tracker.ceph.com/issues/4284 Signed-off-by: Alex Elder Reviewed-by: Greg Farnum --- net/ceph/messenger.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) } diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index f48e2af..e75a03d 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -2690,10 +2690,10 @@ EXPORT_SYMBOL(ceph_con_keepalive); void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages, size_t length, size_t alignment) { - /* BUG_ON(!pages); */ - /* BUG_ON(!length); */ - /* BUG_ON(msg->pages); */ - /* BUG_ON(msg->length); */ + BUG_ON(!pages); + BUG_ON(!length); + BUG_ON(msg->pages); + BUG_ON(msg->length); msg->pages = pages; msg->length = length; @@ -2704,9 +2704,9 @@ EXPORT_SYMBOL(ceph_msg_data_set_pages); void ceph_msg_data_set_pagelist(struct ceph_msg *msg, struct ceph_pagelist *pagelist) { - /* BUG_ON(!pagelist); */ - /* BUG_ON(!pagelist->length); */ - /* BUG_ON(msg->pagelist); */ + BUG_ON(!pagelist); + BUG_ON(!pagelist->length); + BUG_ON(msg->pagelist); msg->pagelist = pagelist; } @@ -2714,8 +2714,8 @@ EXPORT_SYMBOL(ceph_msg_data_set_pagelist); void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio) { - /* BUG_ON(!bio); */ - /* BUG_ON(msg->bio); */ + BUG_ON(!bio); + BUG_ON(msg->bio); msg->bio = bio; } @@ -2723,9 +2723,9 @@ EXPORT_SYMBOL(ceph_msg_data_set_bio); void ceph_msg_data_set_trail(struct ceph_msg *msg, struct ceph_pagelist *trail) { - /* BUG_ON(!trail); */ - /* BUG_ON(!trail->length); */ - /* BUG_ON(msg->trail); */ + BUG_ON(!trail); + BUG_ON(!trail->length); + BUG_ON(msg->trail); msg->trail = trail;