From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760426AbbKTWdr (ORCPT ); Fri, 20 Nov 2015 17:33:47 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:51634 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752474AbbKTWdp (ORCPT ); Fri, 20 Nov 2015 17:33:45 -0500 Date: Fri, 20 Nov 2015 22:33:43 +0000 From: Al Viro To: David Howells Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , linux-security-module@vger.kernel.org, miklos@szeredi.hu Subject: Re: [RFC] readlink()-related oddities Message-ID: <20151120223343.GO22011@ZenIV.linux.org.uk> References: <20151119232635.GI22011@ZenIV.linux.org.uk> <22313.1448013545@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22313.1448013545@warthog.procyon.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 20, 2015 at 09:59:05AM +0000, David Howells wrote: > There's an AFS userspace command that could be used to query a mountpoint that > was going to use it. However, I suspect readlink() will now always trigger > the automount. It won't, actually. All we are passing to user_path_at_empty() is LOOKUP_EMPTY, so for the final component we'll have if (!(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY | LOOKUP_OPEN | LOOKUP_CREATE | LOOKUP_AUTOMOUNT)) && path->dentry->d_inode) return -EISDIR; in follow_automount() trigger and follow_managed() will turn that -EISDIR into 0. IOW, readlink(2) does work on those, same as stat() (since Sep 2011). Sigh... OK, let's leave it for now; ->open() for those guys is completely bogus, AFAICS, but that's local bogo^Wbusiness.