From patchwork Fri Jun 18 13:08:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simone Gotti X-Patchwork-Id: 106853 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5ID8CrK026798 for ; Fri, 18 Jun 2010 13:08:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761219Ab0FRNIL (ORCPT ); Fri, 18 Jun 2010 09:08:11 -0400 Received: from ey-out-2122.google.com ([74.125.78.26]:51582 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761214Ab0FRNIK (ORCPT ); Fri, 18 Jun 2010 09:08:10 -0400 Received: by ey-out-2122.google.com with SMTP id 25so96709eya.19 for ; Fri, 18 Jun 2010 06:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=OuXfeDVp5cYTVs/OpT4UmEtAfFBQbxFjwpUn8f1AwyQ=; b=OVtH6NEdwoXdPLvFu4POXKsihF1tiXs3CmPuZiamg/XMHWE8jg0l+JIJchDNtsMP5m cJTocrY6Ceg6EUkFNyybVJfJFPqVuGHuEOZgq88Is+M+g69iRJaIbz3z6dLSXsNFKONl umW45OdfaA5821ZSYPuFRyzVHy+8Qe2sNE9bE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=TDdKwaqP33d/+byH335E8ziU+pexzr2uUnub3UNwP0sfn45qpJdGmJYTY3lQRaDAeY yZaNCn4xQwIB+5aA9L4WMx0HgetjiyGpRZY9BWmDQvzbzpYaVMMw5Bt8oyrfDqsjvk5n ZDtrg/ylqpeS/zpleewomvkSWkp1zuXICbpiY= Received: by 10.213.5.3 with SMTP id 3mr259144ebt.48.1276866488990; Fri, 18 Jun 2010 06:08:08 -0700 (PDT) Received: from [10.20.0.6] (ns1.sgotti.org [92.243.8.14]) by mx.google.com with ESMTPS id 24sm2077518eyx.24.2010.06.18.06.08.07 (version=SSLv3 cipher=RC4-MD5); Fri, 18 Jun 2010 06:08:08 -0700 (PDT) Message-ID: <4C1B6FB6.6020606@gmail.com> Date: Fri, 18 Jun 2010 15:08:06 +0200 From: Simone Gotti User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Thunderbird/3.0.4 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH] msgr: Fix crash in policy.throttler->get(message_size) when message_size == 0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 18 Jun 2010 13:08:12 +0000 (UTC) diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index a30e075..c15fa04 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -1746,9 +1746,10 @@ Message *SimpleMessenger::Pipe::read_message() << messenger->message_throttler.get_max() << dendl; uint64_t message_size = header.front_len + header.middle_len + header.data_len; - if (message_size) + if (message_size) { messenger->message_throttler.get(message_size); - if (policy.throttler) policy.throttler->get(message_size); + if (policy.throttler) policy.throttler->get(message_size); + } // read front bufferlist front;