Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1273683

Re: [RFC] readlink()-related oddities

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [RFC] readlink()-related oddities
Date 2015-11-20 03:20 +0100
Message-ID <qwJsR-Wv-7@gated-at.bofh.it> (permalink)
References <qwGOm-7Dg-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 19, 2015 at 3:26 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> 1) atime updates, according to POSIX, should happen in case of success.
> For example, giving readlink(2) an unmapped buffer should _not_ touch
> atime.  Neither should calling readlink(2) in case if ->readlink() method
> returns e.g. -EIO or -ENOMEM.  We do atime update in those cases.  Looks
> like a bug and unless there's a good reason to keep that behaviour, I'd
> rather have it do what POSIX says.

I really don't think anybody cares, but I also don't think anybody
cares about the current behavior, so we can certainly fix it to match
POSIX wording, and just move it a bit lower after checking the return
value from ->realink().

> 3) normally, readlink(2) fails for non-symlinks.  Moreover, according to
> POSIX it should do so (with -EINVAL).

I don't think POSIX is necessarily relevant here.

We have had magic file behavior outside the scope of POSIX before, and
we will have it in the future. It makes perfect sense to use
readlink() for management tools for automounting, even if the normal
oepration is to treat the thing as a directory.

Not everything is within the domain of POSIX.

               Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC] readlink()-related oddities Al Viro <viro@ZenIV.linux.org.uk> - 2015-11-20 00:30 +0100
  Re: [RFC] readlink()-related oddities Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-20 03:20 +0100
    Re: [RFC] readlink()-related oddities Al Viro <viro@ZenIV.linux.org.uk> - 2015-11-20 04:00 +0100
      Re: [RFC] readlink()-related oddities Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-20 04:10 +0100
        Re: [RFC] readlink()-related oddities Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-20 04:20 +0100
          Re: [RFC] readlink()-related oddities Al Viro <viro@ZenIV.linux.org.uk> - 2015-11-20 04:30 +0100
      Re: [RFC] readlink()-related oddities David Howells <dhowells@redhat.com> - 2015-11-20 11:10 +0100
  Re: [RFC] readlink()-related oddities David Howells <dhowells@redhat.com> - 2015-11-20 11:00 +0100
    Re: [RFC] readlink()-related oddities Al Viro <viro@ZenIV.linux.org.uk> - 2015-11-20 17:10 +0100
      Re: [RFC] readlink()-related oddities David Howells <dhowells@redhat.com> - 2015-11-20 17:30 +0100
    Re: [RFC] readlink()-related oddities Al Viro <viro@ZenIV.linux.org.uk> - 2015-11-20 23:40 +0100

csiph-web