lkml.org 
[lkml]   [2015]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] readlink()-related oddities
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?


\
 
 \ /
  Last update: 2015-11-20 04:21    [W:0.062 / U:23.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site