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


Groups > linux.kernel > #1273703

Re: [RFC] readlink()-related oddities

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [RFC] readlink()-related oddities
Date 2015-11-20 04:00 +0100
Message-ID <qwK5z-1aE-3@gated-at.bofh.it> (permalink)
References <qwGOm-7Dg-15@gated-at.bofh.it> <qwJsR-Wv-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 19, 2015 at 06:13:53PM -0800, Linus Torvalds wrote:

> > 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.

How would those tools know that this particular pathname _is_ a magical
symlink?  Sure, if you see a symlink with body that starts with % or #,
you could figure out that it's not a regular one and go parse the body,
but for stat(2) it looks like a directory.  Do those tools call readlink()
on every directory they spot on AFS volume?  David?

And what's the story with magical ->open() for those?  How could one get
to ->open() on those sucker and avoid triggering the automount instead?
--
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 | Next — Previous 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