Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752190AbdHHNLR (ORCPT ); Tue, 8 Aug 2017 09:11:17 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:58435 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751998AbdHHNLP (ORCPT ); Tue, 8 Aug 2017 09:11:15 -0400 X-ME-Sender: Message-Id: <1502197874.3935465.1066793424.598228B6@webmail.messagingengine.com> From: Colin Walters To: Ian Kent , Andrew Morton Cc: autofs mailing list , Ondrej Holy , Colin Walters , Kernel Mailing List , David Howells , "linux-fsdevel" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-4448c6f4 In-Reply-To: <150216641255.11652.4204561328197919771.stgit@pluto.themaw.net> Subject: Re: [PATCH 1/3] autofs - fix AT_NO_AUTOMOUNT not being honored References: <150216641255.11652.4204561328197919771.stgit@pluto.themaw.net> Date: Tue, 08 Aug 2017 09:11:14 -0400 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1324 Lines: 30 On Tue, Aug 8, 2017, at 12:26 AM, Ian Kent wrote: > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -3022,8 +3022,7 @@ static inline int vfs_lstat(const char __user *name, struct kstat *stat) > static inline int vfs_fstatat(int dfd, const char __user *filename, > struct kstat *stat, int flags) > { > - return vfs_statx(dfd, filename, flags | AT_NO_AUTOMOUNT, > - stat, STATX_BASIC_STATS); > + return vfs_statx(dfd, filename, flags, stat, STATX_BASIC_STATS); > } > static inline int vfs_fstat(int fd, struct kstat *stat) > { This is reverting the fstatat() prat of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=deccf497d804a4c5fca2dbfad2f104675a6f9102 Which itself seems weird to me - it looks like we were unconditionally forcing on AT_NO_AUTOMOUNT regardless of what userspace passed? So perhaps a Fixes: deccf497d804a4c5fca2dbfad2f104675a6f9102 is appropriate here? I understand that for stat()/lstat() we didn't expose the option to userspace, so the behavior was...ah, there's this note in man-pages (man-pages-4.09-3.fc26.noarch): > On Linux, lstat() will generally not trigger automounter action, whereas stat() will (but see fstatat(2)). I have no idea of the history here, but maybe it makes sense to drop the AT_NO_AUTOMOUNT from the vfs_stat() too?