From patchwork Mon Jun 24 01:22:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: majianpeng X-Patchwork-Id: 2768561 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A1DB79F3A0 for ; Mon, 24 Jun 2013 01:22:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 365C82011F for ; Mon, 24 Jun 2013 01:22:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC5F920113 for ; Mon, 24 Jun 2013 01:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751865Ab3FXBW3 (ORCPT ); Sun, 23 Jun 2013 21:22:29 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:48327 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060Ab3FXBW2 (ORCPT ); Sun, 23 Jun 2013 21:22:28 -0400 Received: by mail-pa0-f41.google.com with SMTP id bj3so10346440pad.28 for ; Sun, 23 Jun 2013 18:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:reply-to:subject:x-priority:x-guid:x-has-attach :x-mailer:mime-version:message-id:content-type :content-transfer-encoding; bh=ovIFxsGYIspnThIhbVMKblsP3aUpgUvQsqucOF7EsyA=; b=mP//MHKjsHpfrcUgVB5Yi0ZYgguurbtMQUHD+TclnyH3H07LGXWldFJw4Q/QMJTwzq HM2DJmRX6h2QmBW+v6BYmacaZGDgq32LXv8D1rQTO710UA8XnJVK8nUI/XIBBEYMPv5X 9uE7uoF8eIOIxMpMY6TPwxv4k7BN7uL8BWGBKp19l/THTA43BtTjhy6nnhpRd2KtrnYl n7liVSNgvC7vPRC90OVNjpUWHDuJpHs/uvLyz61bRzQMbF6nKjWg82dJdp8TL8ymGNiQ UtDLvluNZTl3meZWjb3waA6pO0Wi0vj7+AXHKFkrVaRpPg3NXp924eNTd9fFkY4erAR6 WD7A== X-Received: by 10.68.48.197 with SMTP id o5mr21964721pbn.184.1372036948021; Sun, 23 Jun 2013 18:22:28 -0700 (PDT) Received: from majianpeng ([218.242.10.182]) by mx.google.com with ESMTPSA id aj3sm8558088pad.8.2013.06.23.18.22.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 23 Jun 2013 18:22:26 -0700 (PDT) Date: Mon, 24 Jun 2013 09:22:19 +0800 From: majianpeng To: "Sage Weil" , davem Cc: ceph-devel , linux-kernel , davem Reply-To: majianpeng Subject: [PATCH] libceph: Call con->ops->put(con) if cancel_delayed_work(&con->work) worked. X-Priority: 3 X-GUID: 87C14C1D-6EC1-4AF6-AAD4-91965063FD35 X-Has-Attach: no X-Mailer: Foxmail 7.0.1.90[en] Mime-Version: 1.0 Message-ID: <201306240921544358210@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Because in func queue_con_delay, it will call con->ops->get(con). So if we cancel the work successfully,we must call con->ops->put(con). Otherwise some resource can't free like 'struct ceph_mds_session'. Signed-off-by: Jianpeng Ma --- net/ceph/messenger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.8.1.2 diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index eb0a46a..8207b37 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -661,7 +661,8 @@ void ceph_con_close(struct ceph_connection *con) reset_connection(con); con->peer_global_seq = 0; - cancel_delayed_work(&con->work); + if (cancel_delayed_work(&con->work)) + con->ops->put(con); con_close_socket(con); mutex_unlock(&con->mutex); }