From patchwork Fri Jan 4 09:02:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1931781 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 AD392DFABD for ; Fri, 4 Jan 2013 09:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753925Ab3ADJCq (ORCPT ); Fri, 4 Jan 2013 04:02:46 -0500 Received: from mga01.intel.com ([192.55.52.88]:17477 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753454Ab3ADJCj (ORCPT ); Fri, 4 Jan 2013 04:02:39 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 04 Jan 2013 01:02:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,409,1355126400"; d="scan'208";a="272790004" Received: from zyan5-mobl.sh.intel.com ([10.239.36.28]) by fmsmga002.fm.intel.com with ESMTP; 04 Jan 2013 01:02:35 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org, sage@inktank.com Cc: "Yan, Zheng" Subject: [PATCH 10/29] mds: skip frozen inode when assimilating dirty inodes' rstat Date: Fri, 4 Jan 2013 17:02:01 +0800 Message-Id: <1357290140-17044-11-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" CDir::assimilate_dirty_rstat_inodes() may encounter frozen inodes that are being renamed. Skip these frozen inodes because assimilating inode's rstat require auth pinning the inode. Signed-off-by: Yan, Zheng --- src/mds/CDir.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 20ff469..91636cc 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1022,6 +1022,9 @@ void CDir::assimilate_dirty_rstat_inodes() for (elist::iterator p = dirty_rstat_inodes.begin_use_current(); !p.end(); ++p) { CInode *in = *p; + if (in->is_frozen()) + continue; + inode_t *pi = in->project_inode(); pi->version = in->pre_dirty(); @@ -1040,16 +1043,22 @@ void CDir::assimilate_dirty_rstat_inodes_finish(Mutation *mut, EMetaBlob *blob) elist::iterator p = dirty_rstat_inodes.begin_use_current(); while (!p.end()) { CInode *in = *p; - CDentry *dn = in->get_projected_parent_dn(); ++p; + if (in->is_frozen()) + continue; + + CDentry *dn = in->get_projected_parent_dn(); + mut->auth_pin(in); mut->add_projected_inode(in); in->clear_dirty_rstat(); blob->add_primary_dentry(dn, true, in); } - assert(dirty_rstat_inodes.empty()); + + if (!dirty_rstat_inodes.empty()) + inode->mdcache->mds->locker->mark_updated_scatterlock(&inode->nestlock); }