All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: Sage Weil <sage@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] mds: Use stray dir as base inode for stray reintegration
Date: Thu, 04 Oct 2012 00:01:12 +0800	[thread overview]
Message-ID: <506C6148.8090608@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1210030811350.21194@cobra.newdream.net>

On 10/03/2012 11:17 PM, Sage Weil wrote:
> On Wed, 3 Oct 2012, Yan, Zheng wrote:
>> From: "Yan, Zheng" <zheng.z.yan@intel.com>
>>
>> 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 <zheng.z.yan@intel.com>
> 
> 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:
> 
> 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++) {
> 
>
FYI: MDCache::migrate_stray() uses stray directory as base inode, it requires an update.

      reply	other threads:[~2012-10-03 16:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03 11:40 [PATCH] mds: Use stray dir as base inode for stray reintegration Yan, Zheng
2012-10-03 15:17 ` Sage Weil
2012-10-03 16:01   ` Yan, Zheng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=506C6148.8090608@intel.com \
    --to=zheng.z.yan@intel.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.