From patchwork Wed Oct 3 15:17:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 1542211 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 6E8BF40D8A for ; Wed, 3 Oct 2012 15:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755363Ab2JCPRI (ORCPT ); Wed, 3 Oct 2012 11:17:08 -0400 Received: from cobra.newdream.net ([66.33.216.30]:34041 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932314Ab2JCPRF (ORCPT ); Wed, 3 Oct 2012 11:17:05 -0400 Received: from cobra.newdream.net (localhost [127.0.0.1]) by cobra.newdream.net (Postfix) with ESMTP id 3B91380049; Wed, 3 Oct 2012 08:17:05 -0700 (PDT) Received: by cobra.newdream.net (Postfix, from userid 1031) id 250B980483; Wed, 3 Oct 2012 08:17:05 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by cobra.newdream.net (Postfix) with ESMTP id 1922A80049; Wed, 3 Oct 2012 08:17:05 -0700 (PDT) Date: Wed, 3 Oct 2012 08:17:04 -0700 (PDT) From: Sage Weil X-X-Sender: sage@cobra.newdream.net To: "Yan, Zheng" cc: ceph-devel@vger.kernel.org Subject: Re: [PATCH] mds: Use stray dir as base inode for stray reintegration In-Reply-To: <1349264412-31444-1-git-send-email-zheng.z.yan@intel.com> Message-ID: References: <1349264412-31444-1-git-send-email-zheng.z.yan@intel.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org On Wed, 3 Oct 2012, Yan, Zheng wrote: > From: "Yan, Zheng" > > Server::handle_client_rename() only skips common ancestor check > if source path's base inode is stray directory, but source path's > base inode is mdsdir in the stray reintegration case. > > Signed-off-by: Yan, Zheng Hmm, I think this is a problem because path_traverse() does not know how to get started with a stray dir it doesn't already have. It might make more sense to use the full path here, and make the handle_client_rename() check smarter. I'm testing this: Thanks! sage > --- > src/mds/MDCache.cc | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc > index 8b02b8b..32c9e36 100644 > --- a/src/mds/MDCache.cc > +++ b/src/mds/MDCache.cc > @@ -8288,8 +8288,7 @@ void MDCache::reintegrate_stray(CDentry *straydn, CDentry *rdn) > dout(10) << "reintegrate_stray " << *straydn << " into " << *rdn << dendl; > > // rename it to another mds. > - filepath src; > - straydn->make_path(src); > + filepath src(straydn->get_name(), straydn->get_dir()->get_inode()->ino()); > filepath dst; > rdn->make_path(dst); > > -- > 1.7.11.4 > > --- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/mds/Server.cc b/src/mds/Server.cc index b706b5a..0c3ff96 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5066,7 +5066,8 @@ void Server::handle_client_rename(MDRequest *mdr) // src+dest traces _must_ share a common ancestor for locking to prevent orphans if (destpath.get_ino() != srcpath.get_ino() && - !MDS_INO_IS_STRAY(srcpath.get_ino())) { // <-- mds 'rename' out of stray dir is ok! + !(req->get_source()->is_mds() && + MDS_INO_IS_MDSDIR(srcpath.get_ino()))) { // <-- mds 'rename' out of stray dir is ok! // do traces share a dentry? CDentry *common = 0; for (unsigned i=0; i < srctrace.size(); i++) {