linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Lei Chen <losemyheaven@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Why does d_splice_alias need to check IS_ROOT?
Date: Sat, 26 May 2018 18:12:06 +0100	[thread overview]
Message-ID: <20180526171206.GP30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CAKEZqKJhZNoF-29ymEmAjiYfVn64q5mHrMY9sC2NZ=EDqTHjeA@mail.gmail.com>

On Sun, May 27, 2018 at 12:33:40AM +0800, Lei Chen wrote:
> Hello list,
> 
> I'm insteresting in how hard link and denry lookup work and their
> implementation.
> 
> I know that this interface tries to connect an inode to a dentry, but
> why does it need
> to check whether the inode alias IS_ROOT if the inode represents a directory?
> And the code process in different way according to check result.  What
> occasions
> are they used for?

If it's disconnected (and not an ancestor of the place where we want it),
we can just move it in place, no questions asked.  If it is *NOT*
disconnected, the only thing we can do is to detach it from where it
is and move it over.  Which takes a lot more care wrt locking.

  reply	other threads:[~2018-05-26 17:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-26 16:33 Why does d_splice_alias need to check IS_ROOT? Lei Chen
2018-05-26 17:12 ` Al Viro [this message]
2018-05-27 11:09   ` Lei Chen

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=20180526171206.GP30522@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=losemyheaven@gmail.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).