All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Sage Weil <sage@inktank.com>
Cc: "Yan, Zheng" <zheng.z.yan@intel.com>, ceph-devel@vger.kernel.org
Subject: Re: [PATCH] ceph: add get_name() NFS export callback
Date: Thu, 6 Mar 2014 10:15:18 -0800	[thread overview]
Message-ID: <20140306181518.GA17748@infradead.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1403060832170.316@cobra.newdream.net>

On Thu, Mar 06, 2014 at 08:45:28AM -0800, Sage Weil wrote:
> This one also worries me.  If the r_locked_dir isn't the current parent 
> anymore, then below in ceph_fill_trace we will be doing a d_alloc etc in 
> the wrong directory... at least with the current version of LOOKUPINO.  Is 
> there an MDS patch that is verifying ino2 is correct?  Otherwise, we might 
> be creating a dentry and setting up a lease etc in a different directory  
> than what the MDS has.
> 
> Sigh... the nfsd's behavior when trying to reconnect things is clearly 
> confusing to me.  Even reading through 
> Documentation/filesystems/nfs/Exporting it isn't obvious what nfsd is 
> actually doing with these methods, or what happens if the filesystem isn't 
> in the state it expects it to be.

After the last round of refactoring by Bruce the code should be fairly
readable now.

Anyway, the basic problem is that a directory dentry must always be
connected up to the filesystem root for proper operation, and for
each level of the diretory hierachy nfsd (or rather exportfs) does the
following:

1) call ->get_parent to get the parent.  fail unless this returns a
   parent dentry.

2) call ->get_name for the parent, dentry pair
   assume already connected by other ways if it returns -ENOENT, fail
   for any other error return

3) call lookup_one_len on parent, name return from ->get_name to
   connect the dentry into parent.  If this returns a different dentry
   assume a rename race which should have connected dentry.  Although
   we ensure it really is connected and return -ESTALE otherwise.

  reply	other threads:[~2014-03-06 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 13:19 [PATCH] ceph: add get_name() NFS export callback Yan, Zheng
2014-03-06 16:45 ` Sage Weil
2014-03-06 18:15   ` Christoph Hellwig [this message]
2014-03-06 22:19   ` Yan, Zheng

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=20140306181518.GA17748@infradead.org \
    --to=hch@infradead.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    --cc=zheng.z.yan@intel.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.