From owner-freebsd-fs@FreeBSD.ORG Mon Sep 10 11:50:08 2012 Return-Path: Delivered-To: freebsd-fs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E97991065677 for ; Mon, 10 Sep 2012 11:50:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 601F48FC1B for ; Mon, 10 Sep 2012 11:50:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q8ABo7wZ047654 for ; Mon, 10 Sep 2012 11:50:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8ABo6oX047638; Mon, 10 Sep 2012 11:50:06 GMT (envelope-from gnats) Date: Mon, 10 Sep 2012 11:50:06 GMT Message-Id: <201209101150.q8ABo6oX047638@freefall.freebsd.org> To: freebsd-fs@FreeBSD.org From: Andrey Simonenko Cc: Subject: Re: kern/147881: [zfs] [patch] ZFS "sharenfs" doesn't allow different "exports" options for different hosts X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andrey Simonenko List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2012 11:50:08 -0000 The following reply was made to PR kern/147881; it has been noted by GNATS. From: Andrey Simonenko To: bug-followup@FreeBSD.org Cc: Richard Conto , Martin Matuska Subject: Re: kern/147881: [zfs] [patch] ZFS "sharenfs" doesn't allow different "exports" options for different hosts Date: Mon, 10 Sep 2012 14:40:08 +0300 On Fri, Sep 07, 2012 at 06:10:07PM +0000, Richard Conto wrote: > > > The purpose of the sharenfs property is not to completely replace > > /etc/exports. > > What we have is just a tricky workaround that populates = > /etc/zfs/exports. > > T > > he commands to NFS-share filesystems on illumos are different and our > > options are mostly incompatible with illumos. > > So you e.g. sharenfs=3D"-maproot=3Droot" is invalid if imported on a > > Openindiana system. > >=20 > > Have you considered using just /etc/exports for more-complex = > configurations? > > Yes. It doesn't scale - and scaling is the whole purpose of NFS. It = > also makes it difficult for distributed management of access rights to = > end-user NFS exports. > > I wouldn't mind using a FreeBSD specific attribute to populate = > /etc/zfs/exports with FreeBSD specific values such as is used for = > swapping to ZFS. Merging the two different attributes would either be = > tricky, or the use of the FreeBSD one should cause "sharenfs" to be = > ignored entirely. This is a limitation of exports(5) format, that does not allow to specify all settings for one file system in one line. When I had similar task I allowed to redefine options in one line, so address specifications can inherit already specified settings and can get changed or new settings. For example: /fs -ro -mapall user1 host1 -mapall user2 host2 host3 -rw host4 Here, /fs is exported read-only for host{1,2,3} and read-write for host4, all users are mapped to user1 for host1 and all users are mapped to user2 for host{2,3,4}. More information about format of NFS exports settings that I propose is available here: http://nfse.sourceforge.net/nfs.exports.5.html