[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFx_=L4adTfn=bZ8oK2b-j-+satDhTsaZUGvcVmJ81A_RQ@mail.gmail.com>
Date: Thu, 19 Nov 2015 18:13:53 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
LSM List <linux-security-module@...r.kernel.org>,
Miklos Szeredi <miklos@...redi.hu>,
David Howells <dhowells@...hat.com>
Subject: Re: [RFC] readlink()-related oddities
On Thu, Nov 19, 2015 at 3:26 PM, Al Viro <viro@...iv.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists