From patchwork Fri Nov 30 02:36:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1823421 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 5CAE03FC5A for ; Fri, 30 Nov 2012 02:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755415Ab2K3ChD (ORCPT ); Thu, 29 Nov 2012 21:37:03 -0500 Received: from mga02.intel.com ([134.134.136.20]:8401 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754991Ab2K3ChB (ORCPT ); Thu, 29 Nov 2012 21:37:01 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 29 Nov 2012 18:37:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,189,1355126400"; d="scan'208";a="226945405" Received: from zyan5-mobl.sh.intel.com ([10.239.36.120]) by orsmga001.jf.intel.com with ESMTP; 29 Nov 2012 18:36:59 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org, sage@inktank.com Cc: "Yan, Zheng" Subject: [PATCH 2/5] mds: fix handle_client_openc() hang Date: Fri, 30 Nov 2012 10:36:51 +0800 Message-Id: <1354243014-21072-3-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1354243014-21072-1-git-send-email-zheng.z.yan@intel.com> References: <1354243014-21072-1-git-send-email-zheng.z.yan@intel.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: "Yan, Zheng" handle_client_openc() calls handle_client_open() if the linkage isn't null. handle_client_open() calls rdlock_path_pin_ref() which returns mdr->in[0] directly because mdr->done_locking is true. the problem here is that mdr->in[0] can be NULL if the linkage is remote. Signed-off-by: Yan, Zheng --- src/mds/Server.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 4c66f4a..59d7d3c 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2637,6 +2637,12 @@ void Server::handle_client_openc(MDRequest *mdr) reply_request(mdr, -EEXIST, dnl->get_inode(), dn); return; } + + mdcache->request_drop_non_rdlocks(mdr); + + // remote link, avoid rdlock_path_pin_ref() returning null + if (!mdr->in[0]) + mdr->done_locking = false; handle_client_open(mdr); return;