linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Pádraig Brady" <P@draigbrady.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Linux FS Devel" <linux-fsdevel@vger.kernel.org>,
	"Linux API" <linux-api@vger.kernel.org>
Subject: Re: RFC: renameat(): Add a RENAME_REMOVE flag to unlink hardlinks
Date: Sat, 22 Nov 2014 01:57:03 +0000	[thread overview]
Message-ID: <20141122015703.GX7996@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CALCETrXBFysW3qnOUuhE8=SeiDVtgAkms7mDuHJTG06mK3=knw@mail.gmail.com>

On Fri, Nov 21, 2014 at 05:51:23PM -0800, Andy Lutomirski wrote:
> On Fri, Nov 21, 2014 at 5:50 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > On Sat, Nov 22, 2014 at 01:29:05AM +0000, Pádraig Brady wrote:
> >
> >> > I assume that VFS can handle this correctly if it wants to.
> >>
> >> I was assuming there was a way to distinguish directory entries,
> >> and that's what should be checked first, which is what my
> >> psuedo code patch attempted to show.
> >
> > There isn't, in general.  Sure, if you get the same struct dentry * from
> > both lookups, it's the same one.  But it's not guaranteed to be true on
> > every fs out there if those are non-directories (and for directories there's
> > no multiple hardlinks in the first place).
> 
> Does that mean that the current behavior is inconsistent between filesystems.

No.  You can always check that they point to the same inode.  Which is
precisely what "links to the same file" is about, and which is why rename(2)
had that semantics since way back.  _That_ is easy condition to check.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2014-11-22  1:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 14:17 RFC: renameat(): Add a RENAME_REMOVE flag to unlink hardlinks Pádraig Brady
     [not found] ` <546F4981.8080907-V8g9lnOeT5ydJdNcDFJN0w@public.gmane.org>
2014-11-21 18:09   ` Andy Lutomirski
     [not found]     ` <CALCETrXvVxvG+s39v+NMdvfkeb8YjbYjb6UXgDFg5ifYOjeKsA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-21 18:39       ` Pádraig Brady
2014-11-21 19:55         ` Andy Lutomirski
2014-11-21 20:48           ` Pádraig Brady
2014-11-21 21:18             ` Eric Blake
     [not found]               ` <546FAC18.5020200-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-21 21:29                 ` Andy Lutomirski
     [not found]                   ` <CALCETrUByDgug68FP=cnj-iwSXvbEEHp=S4a=WhQPFmuKc2pNw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-21 22:20                     ` Pádraig Brady
     [not found]                       ` <546FBAC6.6020407-V8g9lnOeT5ydJdNcDFJN0w@public.gmane.org>
2014-11-21 22:30                         ` Al Viro
2014-11-21 22:40                           ` Andy Lutomirski
     [not found]                             ` <CALCETrW0c1UzkVQgEE_je5BtVhdWRmNaYk4HCQk+t6AWvpC-FA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-22  1:29                               ` Pádraig Brady
     [not found]                                 ` <546FE6E1.7040703-V8g9lnOeT5ydJdNcDFJN0w@public.gmane.org>
2014-11-22  1:31                                   ` Andy Lutomirski
2014-11-22  1:50                                   ` Al Viro
     [not found]                                     ` <20141122015010.GW7996-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2014-11-22  1:51                                       ` Andy Lutomirski
2014-11-22  1:57                                         ` 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=20141122015703.GX7996@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=P@draigbrady.com \
    --cc=eblake@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=luto@amacapital.net \
    /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).