Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Aug 2015 22:56:26 +0200
From:      Willem Jan Withagen <wjw@digiware.nl>
To:        Lev Serebryakov <lev@FreeBSD.org>
Cc:        fs@freebsd.org
Subject:   Re: Multiple entries in ZFS "sharenfs" property?
Message-ID:  <55BE83FA.1060208@digiware.nl>
In-Reply-To: <1941826477.20150802210808@serebryakov.spb.ru>
References:  <130767529.20150801150343@serebryakov.spb.ru> <55BDF5D2.3090306@digiware.nl> <1941826477.20150802210808@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2-8-2015 20:08, Lev Serebryakov wrote:
> Hello Willem,
> 
> Sunday, August 2, 2015, 1:49:54 PM, you wrote:
>>>   Is it possible to put multiple entries (for multiple networks) into
>>> "sharenfs" property for ZFS filesystem?
> 
>> Something like?
>>          
>> I think I just did it by putting the text between '' 's:
>>         ' <volume>
> 
>> Which then ends up in /etc/zfs/exports:
>> /home/wjw  -alldirs -maproot=0 -network 192.168.10.0 -mask 255.255.252.0
>  I need 4 such lines per FS (with different -network / -mask arguments). One line works. Four lines don't.

Hi Lev,

Nope, that doesn't work, as far as I can tell.
You'd have to revert to editting /etc/exports.

Or hack on 'zfs set sharenfs' to generate multiple lines, in some sort
of format. Like making ';' a line separator, and then prefix each part
with the volume we are modifying.

Place to give it a go are in:
cddl/compat/opensolaris/misc/fsshare.c:213
        if (share) {
                fprintf(newfd, "%s\t%s\n", mountpoint,
                    translate_opts(shareopts));
        }
And there split the shareopts on the split char (eg. ';') in several
shareopts and then loop over them. Disadvantage is that the max length
op the options is: MAXPATHLEN. So you can easily run out of space if you
have many exports to do.

-WjW





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55BE83FA.1060208>