From patchwork Wed Jan 23 03:08:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 2021861 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 E640DDF2EB for ; Wed, 23 Jan 2013 03:09:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752973Ab3AWDJK (ORCPT ); Tue, 22 Jan 2013 22:09:10 -0500 Received: from mga01.intel.com ([192.55.52.88]:60335 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752769Ab3AWDJH (ORCPT ); Tue, 22 Jan 2013 22:09:07 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 22 Jan 2013 19:09:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,518,1355126400"; d="scan'208";a="280924938" Received: from zyan5-mobl.sh.intel.com ([10.239.36.31]) by fmsmga002.fm.intel.com with ESMTP; 22 Jan 2013 19:09:05 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org, sage@inktank.com Cc: "Yan, Zheng" Subject: [PATCH 03/25] mds: lock remote inode's primary dentry during rename Date: Wed, 23 Jan 2013 11:08:39 +0800 Message-Id: <1358910541-15535-4-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1358910541-15535-1-git-send-email-zheng.z.yan@intel.com> References: <1358910541-15535-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" commit 1203cd2110 (mds: allow open_remote_ino() to open xlocked dentry) makes Server::handle_client_rename() xlocks remote inodes' primary dentry so witness MDS can open xlocked dentry. But I added remote inodes' projected primary dentries to the xlock list. This is wrong because projected dentries are invisible for path traverse. Signed-off-by: Yan, Zheng --- src/mds/Server.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index ebdbfe4..eced76f 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5351,9 +5351,9 @@ void Server::handle_client_rename(MDRequest *mdr) // open_remote_ino() with 'want_locked=true' when the srcdn or destdn // is traversed. if (srcdnl->is_remote()) - xlocks.insert(&srci->get_projected_parent_dn()->lock); + xlocks.insert(&srci->get_parent_dn()->lock); if (destdnl->is_remote()) - xlocks.insert(&oldin->get_projected_parent_dn()->lock); + xlocks.insert(&oldin->get_parent_dn()->lock); } // we need to update srci's ctime. xlock its least contended lock to do that...