From owner-freebsd-fs@freebsd.org Fri Sep 15 16:41:01 2017 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE6CBE219FD; Fri, 15 Sep 2017 16:41:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A22376EB4B; Fri, 15 Sep 2017 16:41:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA21446; Fri, 15 Sep 2017 19:40:59 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dstfn-0001KN-8a; Fri, 15 Sep 2017 19:40:59 +0300 Subject: Re: mount / unmount and mountcheckdirs() To: Konstantin Belousov , Edward Napierala Cc: Kirk McKusick , freebsd-fs , "freebsd-arch@freebsd.org" References: <134c7c6e-f4f1-ef38-cc50-0e56c27c9fb8@FreeBSD.org> <201709150314.v8F3Ea6B085072@chez.mckusick.com> <20170915092001.GK78693@kib.kiev.ua> <20170915103037.GM78693@kib.kiev.ua> <20170915110033.GO78693@kib.kiev.ua> <20170915114533.GS78693@kib.kiev.ua> <20170915162752.GX78693@kib.kiev.ua> From: Andriy Gapon Message-ID: <317b4617-5f0b-bc9a-316f-db1d8cf661fa@FreeBSD.org> Date: Fri, 15 Sep 2017 19:40:22 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170915162752.GX78693@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2017 16:41:02 -0000 On 15/09/2017 19:27, Konstantin Belousov wrote: > On Fri, Sep 15, 2017 at 05:06:10PM +0100, Edward Napierala wrote: >> It does, and that case might work - I'm not sure, but it might. But what >> happens afterwards, after the syscall that triggered the mount completes? >> You would still have a shell with cwd in that dir, now covered by another >> filesystem. Autofs doesn't do anything to "lift" the process to the newly >> mounted filesystem root. > The change of the current directory should have already triggered the action, > because it was preceeded by lookup. At least this is my understanding of > the flow. >From the earlier example I can only conclude that autofs does NOT do a mount on lookup in a sense of *vpp being a root of the mounted filesystem. My interpretation is the mounting is done only if there is a VOP_LOOKUP (or VOP_READDIR) with a mount point as a dvp. -- Andriy Gapon