From: Jeff Layton <jlayton@kernel.org>
To: "Yan, Zheng" <zyan@redhat.com>, ceph-devel@vger.kernel.org
Subject: Re: [PATCH] mds: update dentry lease for async create
Date: Wed, 04 Mar 2020 09:05:27 -0500 [thread overview]
Message-ID: <29ed368fce6cb62f2bbc9b5d181eacf2cdf990bb.camel@kernel.org> (raw)
In-Reply-To: <88afc25efd69e9d07df88bb2efbc3e989e14fd9a.camel@kernel.org>
On Wed, 2020-03-04 at 08:55 -0500, Jeff Layton wrote:
> On Wed, 2020-03-04 at 21:22 +0800, Yan, Zheng wrote:
> > Otherwise ceph_d_delete() may return 1 for the dentry, which makes
> > dput() prune the dentry and clear parent dir's complete flag.
> >
> > Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
> > ---
> > fs/ceph/file.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> > index 53321bf517c2..671b141aedfe 100644
> > --- a/fs/ceph/file.c
> > +++ b/fs/ceph/file.c
> > @@ -480,6 +480,9 @@ static int try_prep_async_create(struct inode *dir, struct dentry *dentry,
> > if (d_in_lookup(dentry)) {
> > if (!__ceph_dir_is_complete(ci))
> > goto no_async;
> > + spin_lock(&dentry->d_lock);
> > + di->lease_shared_gen = atomic_read(&ci->i_shared_gen);
> > + spin_unlock(&dentry->d_lock);
> > } else if (atomic_read(&ci->i_shared_gen) !=
> > READ_ONCE(di->lease_shared_gen)) {
> > goto no_async;
>
> Good catch, merged into testing (with small update to changelog
> s/mds:/ceph:/)
>
One related comment though. This patch implies that lease_shared_gen is
protected by the d_lock, but it's not held when it's assigned in
ceph_lookup. Should it be?
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2020-03-04 14:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 13:22 [PATCH] mds: update dentry lease for async create Yan, Zheng
2020-03-04 13:55 ` Jeff Layton
2020-03-04 14:05 ` Jeff Layton [this message]
2020-03-04 14:26 ` Yan, Zheng
2020-03-04 14:50 ` Jeff Layton
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=29ed368fce6cb62f2bbc9b5d181eacf2cdf990bb.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=zyan@redhat.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