All of lore.kernel.org
 help / color / mirror / Atom feed
From: <changfengnan@vivo.com>
To: "'Matthew Wilcox'" <willy@infradead.org>
Cc: <miklos@szeredi.hu>, <linux-fsdevel@vger.kernel.org>
Subject: 答复: [PATCH] fuse: fix inconsistent status between faccess and mkdir
Date: Fri, 14 May 2021 11:27:06 +0800	[thread overview]
Message-ID: <001a01d74871$044e3ea0$0ceabbe0$@vivo.com> (raw)
In-Reply-To: <YJ3f1lBkwY+9vqss@casper.infradead.org>

we should us d_find_any_alias() rather than d_obtain_alias(), it's my
mistake.

Fuse is support hardlinks, if an inode with two links, we may found wrong
alias, we may need invalidate all dentry, because of the file is not exist
anymore.
But in other kernel code, I didn't see any handling for this situation. I
can't figure out why.

Thanks.

-----邮件原件-----
发件人: Matthew Wilcox <willy@infradead.org> 
发送时间: 2021年5月14日 10:27
收件人: Fengnan Chang <changfengnan@vivo.com>
抄送: miklos@szeredi.hu; linux-fsdevel@vger.kernel.org
主题: Re: [PATCH] fuse: fix inconsistent status between faccess and mkdir

On Fri, May 14, 2021 at 09:55:17AM +0800, Fengnan Chang wrote:
> +++ b/fs/fuse/dir.c
> @@ -1065,6 +1065,14 @@ static int fuse_do_getattr(struct inode *inode,
struct kstat *stat,
>  				fuse_fillattr(inode, &outarg.attr, stat);
>  		}
>  	}
> +	if (err == -ENOENT) {
> +		struct dentry *entry;
> +
> +		entry = d_obtain_alias(inode);

Why d_obtain_alias() instead of d_find_any_alias()?

And what if you find the wrong alias?  ie an inode with two links?
Or does fuse not support hardlinks?




      reply	other threads:[~2021-05-14  3:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14  1:55 [PATCH] fuse: fix inconsistent status between faccess and mkdir Fengnan Chang
2021-05-14  2:26 ` Matthew Wilcox
2021-05-14  3:27   ` changfengnan [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='001a01d74871$044e3ea0$0ceabbe0$@vivo.com' \
    --to=changfengnan@vivo.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=willy@infradead.org \
    /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.