From patchwork Fri Jan 4 09:02:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1931851 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6A741DFABD for ; Fri, 4 Jan 2013 09:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754108Ab3ADJDA (ORCPT ); Fri, 4 Jan 2013 04:03:00 -0500 Received: from mga01.intel.com ([192.55.52.88]:28255 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753030Ab3ADJCo (ORCPT ); Fri, 4 Jan 2013 04:02:44 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 04 Jan 2013 01:02:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,409,1355126400"; d="scan'208";a="272790049" Received: from zyan5-mobl.sh.intel.com ([10.239.36.28]) by fmsmga002.fm.intel.com with ESMTP; 04 Jan 2013 01:02:43 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org, sage@inktank.com Cc: "Yan, Zheng" Subject: [PATCH 16/29] mds: don't defer processing caps if inode is auth pinned Date: Fri, 4 Jan 2013 17:02:07 +0800 Message-Id: <1357290140-17044-17-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1357290140-17044-1-git-send-email-zheng.z.yan@intel.com> References: <1357290140-17044-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 not defer processing caps if the inode is auth pinned by MDRequest, because the MDRequest may change lock state of the inode later and wait for the deferred caps. Signed-off-by: Yan, Zheng --- src/mds/Locker.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index ee2d4cc..dbf4452 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -2199,12 +2199,11 @@ bool Locker::should_defer_client_cap_frozen(CInode *in) * Currently, a request wait if anything locked is freezing (can't * auth_pin), which would avoid any deadlock with cap release. Thus @in * _MUST_ be in the lock/auth_pin set. + * + * auth_pins==0 implies no unstable lock and not auth pinnned by + * client request, otherwise continue even it's freezing. */ - return (in->is_freezing() && (in->filelock.is_stable() && - in->authlock.is_stable() && - in->xattrlock.is_stable() && - in->linklock.is_stable())) || // continue if freezing and lock is unstable - in->is_frozen(); + return (in->is_freezing() && in->get_num_auth_pins() == 0) || in->is_frozen(); } /*