From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161943AbbKTDQf (ORCPT ); Thu, 19 Nov 2015 22:16:35 -0500 Received: from mail-ig0-f178.google.com ([209.85.213.178]:34173 "EHLO mail-ig0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161342AbbKTDQc (ORCPT ); Thu, 19 Nov 2015 22:16:32 -0500 MIME-Version: 1.0 In-Reply-To: References: <20151119232635.GI22011@ZenIV.linux.org.uk> <20151120025749.GJ22011@ZenIV.linux.org.uk> Date: Thu, 19 Nov 2015 19:16:32 -0800 X-Google-Sender-Auth: IPQ-nkmNb6j8bGlnWXGmgAlKsHg Message-ID: Subject: Re: [RFC] readlink()-related oddities From: Linus Torvalds To: Al Viro Cc: linux-fsdevel , Linux Kernel Mailing List , LSM List , Miklos Szeredi , David Howells Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2015 at 7:09 PM, Linus Torvalds wrote: > > So there is *potential* for just making it generic, but that doesn't > mean that it necessarily has to act that way. .. it's not necessarily just readlink() either. I still think it might be a perfectly fine idea to allow non-directories to act as directories in some case (by exposing "readdir" and "lookup"). But readdir() really doesn't sound horrible either. how about unix domain sockets (or named pipes) giving their link information when you do readdir() on them? Quite frankly, I think allowing those kinds of unified interfaces is better than the current situation where you have to use a "getpeername()" system call etc. If it's a filesystem object, why not allow filesystem operations to work on it? We expose some things in /proc as symlinks things that actually would work better as non-symlinks, exactly *because* we want to expose not just the end result of what they point to, but also a *description* of what they point to. So we have those odd "pseudo-symlinks" in /proc that don't actually really do a pathname walk on the symlink content they expose, but still *look* like symlinks just because readdir() is such a useful thing to have. No wonder other users have wanted to use it. Linus