Return-Path: Received: from mx2.netapp.com ([216.240.18.37]:52534 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836Ab1IZWeE convert rfc822-to-8bit (ORCPT ); Mon, 26 Sep 2011 18:34:04 -0400 Subject: Re: [PATCH] VFS: Suppress automount on [l]stat, [l]getxattr, etc. From: Trond Myklebust To: Linus Torvalds Cc: Ian Kent , Jeff Layton , Miklos Szeredi , David Howells , viro@zeniv.linux.org.uk, gregkh@suse.de, linux-nfs@vger.kernel.org, leonardo.lists@gmail.com Date: Mon, 26 Sep 2011 18:33:44 -0400 In-Reply-To: References: <1316747758.3346.89.camel@perseus.themaw.net> <20110922134510.24683.14576.stgit@warthog.procyon.org.uk> <1316707443.3346.44.camel@perseus.themaw.net> <1316709935.3346.48.camel@perseus.themaw.net> <20110922133529.6d3ea8de@barsoom.rdu.redhat.com> <20110922144453.6cf53a25@barsoom.rdu.redhat.com> <1316719228.3968.14.camel@lade.trondhjem.org> <2E1EB2CF9ED1CB4AA966F0EB76EAB4430B480BD4@SACMVEXC2-PRD.hq.netapp.com> <21772.1316774025@redhat.com> <1316788444.14812.10.camel@lade.trondhjem.org> <29743.1316791138@redhat.com> <87hb43tf2g.fsf@tucsk.pomaz.szeredi.hu> <1316827854.3346.154.camel@perseus.themaw.net> <20110924073610.4b045189@tlielax.poochiereds.net> <1317013864.3187.81.camel@perseus.themaw.net> <1317071626.19951.8.camel@lade.trondhjem.org> <1317072718.19951.13.camel@lade.trondhjem.org> Content-Type: text/plain; charset="UTF-8" Message-ID: <1317076424.19951.32.camel@lade.trondhjem.org> Sender: linux-nfs-owner@vger.kernel.org List-ID: MIME-Version: 1.0 On Mon, 2011-09-26 at 15:24 -0700, Linus Torvalds wrote: > On Mon, Sep 26, 2011 at 2:31 PM, Trond Myklebust > wrote: > > > > A bind mount doesn't actually want us to set up OPEN state on the NFSv4 > > server and return a fully initialised 'struct file' in the struct > > nameidata. If it did, we would already have set the LOOKUP_OPEN flag > > together with the accompanying open intent structure in the struct > > nameidata. > > > > Ditto for the quotactl(). > > Umm. As far as I can see, adding LOOKUP_OPEN doesn't actually even > *do* what you claim. > > The whole "allocate struct file in struct nameidata" happens in > path_openat(), it doesn't happen in the normal path creation > (do_path_lookup() and friends). The only thing NFS does with > LOOKUP_OPEN is to check whether it needs to do a revalidate > regardless. Please see the 'is_atomic_open()' helper and the way that nfs_atomic_lookup() will substitute an OPEN call for the usual LOOKUP if it sees that the caller is trying to open a file that might potentially be a regular file. > But even more importantly than your apparent confusion about filling > in the 'nameidata.intent' fields, even *if* we were to do unnecessary > filp allocations etc (which we don't do, as mentioned), from a user > standpoint, what would be the actual downside? Lookup permission checks would be replaced with open permission checks on the server. IOW: the operation could potentially fail due to a completely unrelated issue. Cheers Trond -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@netapp.com www.netapp.com