Why does NFSv4 export a whole dataset, not a folder of the dataset?

nfs config of /etc/rc.conf
Code:
nfs_server_enable="YES"
nfsv4_server_enable="YES"
nfsv4_server_only="YES"

exports of /etc/exports
Code:
V4: /storage0

/storage0/apps/gogs -mapall=lsz:lsz 192.168.2.11 192.168.2.20

- /storage0 is a zpool
- /storage0/apps is a dataset of zpool 'storage0'
- /storage0/apps/gogs is a folder of dataset 'storage0/apps'
- /storage0/apps/pg is a folder of dataset 'storage0/apps'
- /storage0/apps/ql is a folder of dataset 'storage0/apps'

And with that /etc/exports config I can mount '/storage0/apps/pg' on an NFS client with NFSv4.

If I change /etc/exports to:
Code:
V4: /storage0

/storage0/apps/gogs -mapall=lsz:lsz 192.168.2.11 192.168.2.20

/storage0/apps/pg -mapall=lsz:lsz 192.168.2.11 192.168.2.20

I get an error:

Code:
Sep 22 14:38:20 gen10 mountd[1118]: can't change attributes for /storage0/apps: netcred already exists for given addr/mask
Sep 22 14:38:20 gen10 mountd[1118]: can't change attributes for /storage0/apps/pg: netcred already exists for given addr/mask
Sep 22 14:38:20 gen10 mountd[1118]: bad exports list line '/storage0/apps/pg -mapall'

I guess that NFSv4 exports the whole 'storage0/apps' dataset because of the config '/storage0/apps/gogs' line, so the config '/storage0/apps/pg' line exports the 'storage0/apps' dataset twice. And so I have this error.

Is that right? How can I export a folder of the dataset, not the whole dataset with NFSv4?
 
Back
Top