All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Jan Kara <jack@suse.cz>
Cc: bianpan2016@163.com, Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] namei: free new_dentry late
Date: Tue, 27 Nov 2018 11:33:33 +0100	[thread overview]
Message-ID: <CAJfpeguWXT5w20tGeJ55CHBvp_3prYWKnxSPd3Osj3wXp68PMQ@mail.gmail.com> (raw)
In-Reply-To: <20181127100536.GF16301@quack2.suse.cz>

On Tue, Nov 27, 2018 at 11:05 AM Jan Kara <jack@suse.cz> wrote:
>
> On Tue 27-11-18 17:57:12, PanBian wrote:

> > I am not quite sure about the actual execution logic. But I guess new_dentry
> > reference may be dropped outside vfs_rename in cocurrent executions.
> > Otherwise, there is no need to acquire & drop new_dentry reference as it
> > is always alive along vfs_rename.
>
> I don't think that's the case. The dget() - dput() pair just looks
> superfluous to me in vfs_rename(). Am I missing something Miklos?

I think those are to protect against d_delete() called from fs to
reset d_inode.  The caller indeed has to hold one ref anyway.

So not superfluous, but only needed due to d_delete() and not to
protect against freeing of dentry.

Thanks,
Miklos

      reply	other threads:[~2018-11-27 10:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25  0:15 [PATCH V2] namei: free new_dentry late Pan Bian
2018-11-27  9:25 ` Jan Kara
2018-11-27  9:57   ` PanBian
2018-11-27 10:05     ` Jan Kara
2018-11-27 10:33       ` Miklos Szeredi [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=CAJfpeguWXT5w20tGeJ55CHBvp_3prYWKnxSPd3Osj3wXp68PMQ@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=bianpan2016@163.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.