All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <alex.elder@linaro.org>
To: "Yan, Zheng" <zheng.z.yan@intel.com>
Cc: ceph-devel@vger.kernel.org, sage@inktank.com
Subject: Re: [PATCH 2/2] ceph: use d_invalidate() to invalidate aliases
Date: Tue, 03 Sep 2013 08:48:50 -0500	[thread overview]
Message-ID: <5225E8C2.9020202@linaro.org> (raw)
In-Reply-To: <1378106394-14481-2-git-send-email-zheng.z.yan@intel.com>

On 09/02/2013 02:19 AM, Yan, Zheng wrote:
> From: "Yan, Zheng" <zheng.z.yan@intel.com>
> 
> d_invalidate() is the standard VFS method to invalidate dentry.
> compare to d_delete(), it also try shrinking children dentries.

I'm less familiar with this code than rbd and the osd client,
so you probably want another reviewer.
I have one comment though, below.

> Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
> ---
>  fs/ceph/caps.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index 7b451eb..13976c3 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -2346,10 +2346,10 @@ static void invalidate_aliases(struct inode *inode)
>  	d_prune_aliases(inode);
>  	/*
>  	 * For non-directory inode, d_find_alias() only returns
> -	 * connected dentry. After calling d_delete(), the dentry
> -	 * become disconnected.
> +	 * connected dentry. After calling d_invalidate(), the
> +	 * dentry become disconnected.
>  	 *
> -	 * For directory inode, d_find_alias() only can return
> +	 * For directory inode, d_find_alias() can return
>  	 * disconnected dentry. But directory inode should have
>  	 * one alias at most.
>  	 */
> @@ -2358,7 +2358,7 @@ static void invalidate_aliases(struct inode *inode)
>  			dput(dn);
>  			break;
>  		}
> -		d_delete(dn);
> +		d_invalidate(dn);

Unlike d_delete(), d_invalidate() can return an error, and in
particular will return an error if there are other dentries
reachable from the one being invalidated.  Do you need to check
for and handle an error here?

					-Alex

>  		if (prev)
>  			dput(prev);
>  		prev = dn;
> 


  reply	other threads:[~2013-09-03 13:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-02  7:19 [PATCH 1/2] ceph: remove ceph_lookup_inode() Yan, Zheng
2013-09-02  7:19 ` [PATCH 2/2] ceph: use d_invalidate() to invalidate aliases Yan, Zheng
2013-09-03 13:48   ` Alex Elder [this message]
2013-09-03 13:40 ` [PATCH 1/2] ceph: remove ceph_lookup_inode() Alex Elder

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=5225E8C2.9020202@linaro.org \
    --to=alex.elder@linaro.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.