From root@phallus.wzff.de  Tue Nov 15 18:41:11 2011
Return-Path: <root@phallus.wzff.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58758106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Nov 2011 18:41:11 +0000 (UTC)
	(envelope-from root@phallus.wzff.de)
Received: from wzff.de (phallus.wzff.de [176.9.47.245])
	by mx1.freebsd.org (Postfix) with ESMTP id EA5358FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Nov 2011 18:41:10 +0000 (UTC)
Received: from phallus.wzff.de ([127.0.1.1])
	by wzff.de (8.14.4/8.14.4) with ESMTP id pAFIf8p7026647
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Nov 2011 18:41:08 GMT
	(envelope-from root@phallus.wzff.de)
Received: (from root@localhost)
	by phallus.wzff.de (8.14.5/8.14.5/Submit) id pAFIf85I026646;
	Tue, 15 Nov 2011 18:41:08 GMT
	(envelope-from root)
Message-Id: <201111151841.pAFIf85I026646@phallus.wzff.de>
Date: Tue, 15 Nov 2011 18:41:08 GMT
From: mw@wzff.de
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: cross-filesystem nullfs does not work as expected
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         162591
>Category:       kern
>Synopsis:       [nullfs] cross-filesystem nullfs does not work as expected
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 15 18:50:06 UTC 2011
>Closed-Date:    
>Last-Modified:  Sat Aug 31 15:50:00 UTC 2013
>Originator:     Moritz Wilhelmy
>Release:        FreeBSD 9.0-RC2 amd64
>Organization:
>Environment:
System: FreeBSD phallus.wzff.de 9.0-RC2 FreeBSD 9.0-RC2 #14: Wed Nov 9 10:27:26 UTC 2011 root@phallus.wzff.de:/usr/obj/usr/src/sys/PHALLUS amd64

>Description:
 mounting a tree with mount_nullfs does not work as expected if the
 filesystem has other nullfs filesystems mounted below. The files from the tree
 itself show up, but not the files from mountpoints under the tree. See below for
 an example.
 Expected behaviour would be that all mountpoints from the nullfs mount show up
 on the tree that it's mounted on.

>How-To-Repeat:
 My original use-case:
  # mkdir -p testdir shares/testdir somejail/shares
  # touch testdir/{moo,cow}
  # ls testdir
  cow moo
  # mount_nullfs -o ro testdir shares/testdir
  # mount_nullfs -o ro shares somejail/shares
  # ls shares/testdir/
  cow moo
  # ls somejail/shares/testdir/
  # ^^^^ no files here
>Fix:
 Unknown
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Nov 21 00:01:18 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=162591 

From: Gleb Kurtsou <gleb.kurtsou@gmail.com>
To: bug-followup@FreeBSD.org, mw@wzff.de
Cc:  
Subject: Re: kern/162591: [nullfs] cross-filesystem nullfs does not work as
 expected
Date: Mon, 21 Nov 2011 16:23:47 +0200

 That is expected behaviour, according to mount_nullfs(8):
 	The mount_nullfs utility creates a null layer, duplicating a
 	sub-tree of the file system name space under another part of the
 	global file system namespace.
 
 It mentions sub-tree of a single file system only. nullfs is technically
 very different from loop mounts in Linux or nullfs in DragonFly, it
 doesn't map part of file name space elsewhere, but duplicates file
 system sub-tree.
 
 Messing with v_mountedhere in nullfs would bring much more trouble than
 it can potentially solve: VFS_VGET(), full path lookups, etc.  We could
 add mount option to automatically nullfs-mount nested mounts, but it
 also feels overcomplicated: unmounting may be difficult, should we track
 new mounts, etc. Mounting nullfs over nullfs is a very bad idea imo (it
 it's not forbidden, I'd also suggest not to NFS export nullfs).
 
 I think writing a small script to do nested mounts/unmounts that suites
 your needs would be the best option here.

From: Moritz Wilhelmy <moritz@barfooze.de>
To: bug-followup@FreeBSD.org, Gleb Kurtsou <gleb.kurtsou@gmail.com>
Cc:  
Subject: Re: kern/162591: [nullfs] cross-filesystem nullfs does not work as
 expected
Date: Sat, 31 Aug 2013 17:46:06 +0200

 On Mon, Nov 21, 2011 at 16:23:47 +0200, Gleb Kurtsou wrote:
 > That is expected behaviour, according to mount_nullfs(8):
 -snip-
 
 Alright. Care to close the PR then?
 
 > I think writing a small script to do nested mounts/unmounts that suites
 > your needs would be the best option here.
 
 That's what I've done. Thanks!
>Unformatted:
