From patchwork Fri Dec 28 00:07:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 1913981 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 DA0303FF0F for ; Thu, 27 Dec 2012 23:59:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751182Ab2L0X7O (ORCPT ); Thu, 27 Dec 2012 18:59:14 -0500 Received: from cobra.newdream.net ([66.33.216.30]:44063 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944Ab2L0X7N (ORCPT ); Thu, 27 Dec 2012 18:59:13 -0500 Received: from fatty.ops.newdream.net (unknown [38.122.20.226]) by cobra.newdream.net (Postfix) with ESMTPA id 69CA280069; Thu, 27 Dec 2012 15:59:13 -0800 (PST) From: Sage Weil To: ceph-devel@vger.kernel.org Cc: Sage Weil Subject: [PATCH] libceph: fix protocol feature mismatch failure path Date: Thu, 27 Dec 2012 16:07:20 -0800 Message-Id: <1356653240-23146-1-git-send-email-sage@inktank.com> X-Mailer: git-send-email 1.7.9 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org We should not set con->state to CLOSED here; that happens in ceph_fault() in the caller, where it first asserts that the state is not yet CLOSED. Avoids a BUG when the features don't match. Signed-off-by: Sage Weil --- net/ceph/messenger.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 4d111fd..24a5c86 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1508,9 +1508,9 @@ static int process_banner(struct ceph_connection *con) static void fail_protocol(struct ceph_connection *con) { + dout("fail_protocol %p\n", con); reset_connection(con); BUG_ON(con->state != CON_STATE_NEGOTIATING); - con->state = CON_STATE_CLOSED; } static int process_connect(struct ceph_connection *con)