From lou@neutron.lbl.gov  Tue Jan  1 07:25:01 2013
Return-Path: <lou@neutron.lbl.gov>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 315BE339
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  1 Jan 2013 07:25:01 +0000 (UTC)
	(envelope-from lou@neutron.lbl.gov)
Received: from neutron.lbl.gov (neutron.lbl.gov [131.243.188.13])
	by mx1.freebsd.org (Postfix) with ESMTP id 163EE8FC12
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  1 Jan 2013 07:25:00 +0000 (UTC)
Received: from neutron.lbl.gov (neutron [127.0.0.1])
	by neutron.lbl.gov (8.14.5/8.14.5) with ESMTP id r016xAQX003986
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 31 Dec 2012 22:59:15 -0800 (PST)
	(envelope-from lou@neutron.lbl.gov)
Received: (from lou@localhost)
	by neutron.lbl.gov (8.14.5/8.14.5/Submit) id r016x5EY003985;
	Mon, 31 Dec 2012 22:59:05 -0800 (PST)
	(envelope-from lou)
Message-Id: <201301010659.r016x5EY003985@neutron.lbl.gov>
Date: Mon, 31 Dec 2012 22:59:05 -0800 (PST)
From: Tak Pui Lou <TPLou@LBL.gov>
Reply-To: Tak Pui Lou <TPLou@LBL.gov>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: mountd fails to work inside init_chroot
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         174877
>Category:       kern
>Synopsis:       [chroot] mountd fails to work inside init_chroot [regression]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 01 07:30:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Sun Mar 10 05:06:05 UTC 2013
>Originator:     Tak Pui Lou
>Release:        FreeBSD 9.1-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD neutron.lbl.gov 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r244804M: Fri Dec 28 19:05:54 PST 2012 lou@neutron.lbl.gov:/usr/obj/usr/src/sys/GENERIC amd64

>Description:
Since some revision after r231239, mountd fails to work inside a chroot
started by an mfsroot preloaded image's init.

>How-To-Repeat:
Load a mfsroot preloaded image from loader.conf and set init_chroot=/system.
/system is a zfs boot filesystem and has other zfs filesystems (e.g. /etc,
/bin, /lib, /libexec, ... ) mounted under its subdirectories. Boot this
and export filesystem under /system.

I think there is some changes to make mountd to work with jail and these
changes make mountd lookup the exports path outside init_chroot instead
of inside init_chroot. Therefore, it gives the following error messages:

Dec 31 21:33:45 ------- mountd[1990]: can't export /export 
Dec 31 21:33:45 ------- mountd[1990]: bad exports list line /export

>Fix:

The export files and sharenfs parameters works when mountd is not inside
init_chroot system. But, it is sometimes useful to have an init_chroot
system. So, it would be nice if this can get a proper fix from the source.
>Release-Note:
>Audit-Trail:
>Unformatted:
