From owner-freebsd-fs@FreeBSD.ORG Wed Aug 17 20:51:07 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C28B106566B for ; Wed, 17 Aug 2011 20:51:07 +0000 (UTC) (envelope-from Martin.Birgmeier@aon.at) Received: from email.aon.at (smtpout03.highway.telekom.at [195.3.96.115]) by mx1.freebsd.org (Postfix) with ESMTP id BA25A8FC1B for ; Wed, 17 Aug 2011 20:51:06 +0000 (UTC) Received: (qmail 15674 invoked from network); 17 Aug 2011 20:51:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.0 (2007-05-01) on WARSBL604.highway.telekom.at X-Spam-Level: Received: from 188-23-212-142.adsl.highway.telekom.at (HELO gandalf.xyzzy) ([188.23.212.142]) (envelope-sender ) by smarthub77.res.a1.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 17 Aug 2011 20:51:03 -0000 Received: from atpcdvvc.xyzzy (atpcdvvc.xyzzy [IPv6:fec0:0:0:4d42::84]) by gandalf.xyzzy (8.14.4/8.14.4) with ESMTP id p7HKp33j024521 for ; Wed, 17 Aug 2011 22:51:03 +0200 (CEST) (envelope-from Martin.Birgmeier@aon.at) Message-ID: <4E4C29B7.3010806@aon.at> Date: Wed, 17 Aug 2011 22:51:03 +0200 From: Martin Birgmeier User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:5.0) Gecko/20110708 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-fs@freebsd.org References: <4E4657BD.2090803@aon.at> <20110816101229.GA2012@pm513-1.comsys.ntu-kpi.kiev.ua> In-Reply-To: <20110816101229.GA2012@pm513-1.comsys.ntu-kpi.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Does nfse support specifying multiple exports for one mount point? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2011 20:51:07 -0000 Thank you Andrey. Regards, Martin On 08/16/11 12:12, Andrey Simonenko wrote: > On Sat, Aug 13, 2011 at 12:53:49PM +0200, Martin Birgmeier wrote: >> See http://www.freebsd.org/cgi/query-pr.cgi?pr=147881 - can I specify >> multiple exports with nfse? >> >> I am using the patch proposed in PR 147881, even though I believe it is >> incomplete (I read that somewhere). For me, it is working fine; for >> example, I have >> >> [0]# zfs list -o name,sharenfs hal.1/backup/dumps >> NAME SHARENFS >> hal.1/backup/dumps -network 192.168.0.0 -mask 255.255.0.0;-network >> fec0:0:0:4d42::/56 >> [0]# >> >> which in /etc/zfs/exports translates to >> >> /z/backup/dumps -network 192.168.0.0 -mask 255.255.0.0 >> /z/backup/dumps -network fec0:0:0:4d42::/56 >> >> How can I specify this using nfse? >> > PR/147881 proposes a way how to specify different options for different > address specifications in one line. Eg. different -mapall options for > different hosts in one line. > > > From the nfs.exports(5) manual page: after any address specification it is > possible to use already specified option in the same line and its value will > overwrite previous option's value and it will be used for next address > specification. > > Such options are: -mapall and -maproot, -ro and -rw, -sec. It is possible > to create reverse logic options for -no_* and -mnt_export_brief options > as well. > > The ``*'' hostname represents default export and can be used in a line with > other address specification. > > Example: > > % cat exports > /fs -ro -mapall 1:2:3 1.1.1.1 -sec krb5 -maproot 2:3:4 * 2.2.2.2 -rw 3.3.3.3 > % nfse -t exports > configure: reading file exports > > Pathname /fs > Export specifications: > -rw -sec krb5 -maproot 2:3:4 -host 3.3.3.3 > -ro -sec krb5 -maproot 2:3:4 -host 2.2.2.2 > -ro -sec sys -mapall 1:2:3 -host 1.1.1.1 > -ro -sec krb5 -maproot 2:3:4 * > > The exports(5) manual page says that address specifications must be specified > after options. The nfs.exports(5) file format allows to use options after > address specifications, so they can overwrite previously specified options. > > If you applied cddl.diff patch, then you can use zfs share/unshare to change > ZFS NFS exports, and of course they will be changed atomically and changes > will be applied only for one file system in a time. As a result if one used > zfs share/unshare for ZFS file system, then exports settings from other > exports files for this file system will be flushed. > > The -alldirs options is also supported by the "zfs share" command, but > its logic does not follow logic described in nfs.exports(5). If the -alldirs > options is used then nfse will create two exports: "/fs ..." and > "/fs -subdir -alldirs ...". This is because of logic how zfs share/unshare > works: > > 1. "zfs sharenfs ..." are not incremental. When we run "zfs sharenfs" > for some file system it completely substitutes its settings. > > 2. There is no way to pass several settings for one file system at least > for mountd. > > 3. "zfs sharenfs" does not allow to export subdirectories. > > If you unsure about configuration logic for nfse, then just call "nfse -t" > and verify its output. At any time run "nfse -c show" and verify current > NFS exports settings. If you prefer to run nfse(8) in compatible mode with > mountd(8), then run it with the -C switch. > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > >