From: Al Viro <viro@zeniv.linux.org.uk>
To: Hou Tao <houtao1@huawei.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
yi.zhang@huawei.com
Subject: Re: [PATCH] dcache: ensure d_flags & d_inode are consistent in lookup_fast()
Date: Mon, 22 Apr 2019 16:55:20 +0100 [thread overview]
Message-ID: <20190422155520.GJ2217@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20190419084810.63732-1-houtao1@huawei.com>
On Fri, Apr 19, 2019 at 04:48:10PM +0800, Hou Tao wrote:
> The root cause is the inconsistency between d_flags & d_inode
> during the REF-walk in lookup_fast(): d_is_negative(dentry)
> returns false, but d_backing_inode() still returns a NULL pointer.
>
> The RCU-walk path in lookup_fast() uses d_seq to ensure d_flags & d_inode
> are consistent, and lookup_slow() use inode lock to ensure that, so only
> the REF-walk path in lookup_fast() is problematic.
>
> Fixing it by adding a paired smp_rmb/smp_wmb between the reading/writing
> of d_inode & d_flags to ensure the consistency.
The problem is real, but I'm not sure I like the proposed fix ;-/
We could simply use d_really_is_negative() there, avoiding all that
mess. If and when we get around to whiteouts-in-dcache (i.e. if
unionfs series gets resurrected), we can revisit that...
prev parent reply other threads:[~2019-04-22 15:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-19 8:48 [PATCH] dcache: ensure d_flags & d_inode are consistent in lookup_fast() Hou Tao
2019-04-22 15:02 ` Hou Tao
2019-04-22 15:55 ` Al Viro [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=20190422155520.GJ2217@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=houtao1@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yi.zhang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).