From patchwork Wed Mar 13 01:02: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: 2260521 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 228113FCF6 for ; Wed, 13 Mar 2013 01:03:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932509Ab3CMBDE (ORCPT ); Tue, 12 Mar 2013 21:03:04 -0400 Received: from mail-oa0-f54.google.com ([209.85.219.54]:34123 "EHLO mail-oa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932103Ab3CMBDD (ORCPT ); Tue, 12 Mar 2013 21:03:03 -0400 Received: by mail-oa0-f54.google.com with SMTP id n12so531792oag.13 for ; Tue, 12 Mar 2013 18:03:02 -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 :content-type:content-transfer-encoding:x-gm-message-state; bh=VqJJMp0AWoqfHbTwrRXT9AiHY6K0+RNxFkg6U+MRoUo=; b=HYIvhnZpr3v+bWizA3md0cl1AwjJwwQ79iSjh3eKP1RFpFkMhVhyA3oyaAqXrC4YXU 0T2vq02LBOfN6xIe1juwComr0yMvve6B84OXNAvYp4kcAePkLwXTbAgPI8ddlrqac5FX +LEezOt4tzDJJAIryckEvJzdOEwP0gEs1AW6PchhBxHZwWS0FrzvcRcx3kphSjKD/a38 xbjBc5mqO7OpARBVNjdUWzvMK3VWdbCQaoSc6O3K082/9o97SNAF4HtRsK0PwPscJoHM Vg4FuTTHn41y64v+MYPU+d1IgCft8YtE0j3qGnVZYsXInnfBaYILpfls8/RXq7Yd6cS7 EOEA== X-Received: by 10.182.23.101 with SMTP id l5mr14005555obf.16.1363136582137; Tue, 12 Mar 2013 18:03:02 -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 ESMTPS id bq8sm23685819obc.9.2013.03.12.18.03.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 18:03:01 -0700 (PDT) Message-ID: <513FD043.30707@inktank.com> Date: Tue, 12 Mar 2013 20:02:59 -0500 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] libceph: no outbound zero data X-Gm-Message-State: ALoCoQl8H81mCaGL1lw6pQ+jU/Uxj8U9I/M4kadovvogQ+3lfdl/yPBYyy8YFCEjBA+KvpRIzX4W Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org There is handling in write_partial_message_data() for the case where only the length of--and no other information about--the data to be sent has been specified. It uses the zero page as the source of data to send in this case. This case doesn't occur. All message senders set up a page array, pagelist, or bio describing the data to be sent. So eliminate the block of code that handles this (but check and issue a warning for now, just in case it happens for some reason). This resolves: http://tracker.ceph.com/issues/4426 Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- net/ceph/messenger.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) u32 crc = le32_to_cpu(msg->footer.data_crc); diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 0d54ca4..c3f2fa1 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1506,13 +1506,10 @@ static int write_partial_message_data(struct ceph_connection *con) &length, &last_piece); #endif } else { - size_t resid = data_len - msg_pos->data_pos; - - page = zero_page; - page_offset = msg_pos->page_pos; - length = PAGE_SIZE - page_offset; - length = min(resid, length); - last_piece = length == resid; + WARN(1, "con %p data_len %u but no outbound data\n", + con, data_len); + ret = -EINVAL; + goto out; } if (do_datacrc && !msg_pos->did_page_crc) {