From patchwork Thu Oct 25 12:26:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1643621 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 2478E3FC36 for ; Thu, 25 Oct 2012 12:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758952Ab2JYM1E (ORCPT ); Thu, 25 Oct 2012 08:27:04 -0400 Received: from mga03.intel.com ([143.182.124.21]:50693 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758942Ab2JYM1D (ORCPT ); Thu, 25 Oct 2012 08:27:03 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 25 Oct 2012 05:27:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,646,1344236400"; d="scan'208";a="209165576" Received: from unknown (HELO zyan5-mobl.ccr.corp.intel.com) ([10.255.21.91]) by azsmga001.ch.intel.com with ESMTP; 25 Oct 2012 05:27:00 -0700 From: "Yan, Zheng" To: sage@inktank.com, ceph-devel@vger.kernel.org Cc: "Yan, Zheng" Subject: [PATCH 4/4] mds: Allow evaluating locks in replica object. Date: Thu, 25 Oct 2012 20:26:52 +0800 Message-Id: <1351168012-4981-4-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1351168012-4981-1-git-send-email-zheng.z.yan@intel.com> References: <1351168012-4981-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" We should allow Locker::try_eval(MDSCacheObject *, int) to evaluate locks in replica objects. Otherwise the locks in replica objects may stuck on unstable states forever. Signed-off-by: Yan, Zheng --- src/mds/Locker.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index a03789f..2c840a9 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -834,12 +834,7 @@ void Locker::try_eval(MDSCacheObject *p, int mask) return; } - if (!p->is_auth()) { - dout(7) << "try_eval not auth for " << *p << dendl; - return; - } - - if (!p->can_auth_pin()) { + if (p->is_auth() && !p->can_auth_pin()) { dout(7) << "try_eval can't auth_pin, waiting on " << *p << dendl; p->add_waiter(MDSCacheObject::WAIT_UNFREEZE, new C_Locker_Eval(this, p, mask)); return; @@ -847,9 +842,11 @@ void Locker::try_eval(MDSCacheObject *p, int mask) if (mask & CEPH_LOCK_DN) { assert(mask == CEPH_LOCK_DN); - bool need_issue = false; // ignore this, no caps on dentries - CDentry *dn = (CDentry *)p; - simple_eval(&dn->lock, &need_issue); + if (p->is_auth()) { + bool need_issue = false; // ignore this, no caps on dentries + CDentry *dn = (CDentry *)p; + simple_eval(&dn->lock, &need_issue); + } } else { CInode *in = (CInode *)p; eval(in, mask);