Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datasets appear as empty when shared through NFS #769

Open
monroo opened this issue Jun 18, 2020 · 5 comments
Open

Datasets appear as empty when shared through NFS #769

monroo opened this issue Jun 18, 2020 · 5 comments

Comments

@monroo
Copy link

monroo commented Jun 18, 2020

Hi all,

I was trying to create a couple of NFS shares on my file server and failing miserably. After hours of trial and error I noticed that if I share a dataset directly it appears as an empty folder on client but if I share a subdirectory of the same dataset all works as expected.

I will try and elaborate a little:

My test setup is macOS v10.15.5, OoX 1.9.4 on the server and Ubuntu Mate 20.04 on the client. Zpool has “com.apple.ignoreowner=on” all datasets and all datasets and all their subdirectories have "drwxr-xr-x" for file permissons. Also here are the zpools/zfs' flags:

NAME RECSIZE CHECKSUM COMPRESS COM.APPLE.IGNOREOWNER COM.APPLE.MIMIC_HFS
tank 128K on lz4 on off
tank/Music 128K on lz4 on off

  1. If a dataset is shared through NFS as
    #/etc/exports
    /Volumes/tank/Music -mapall=-2:-2 -ro

it can be mounted by the client but when opened, the mount point appears as an empty directory. Caja reports “Empty Space” correctly but it shows “0 Items”. More interestingly “ls” command returns an “Input/output error.” but “cd Concerts” works as expected. And when in Concerts directory "ls" command also works as expected. Please note that “tank” is the zpool, “Music” is a dataset and “Concerts” is a regular directory.

  1. If a subfolder of a dataset is shared through NFS, it works as expected. Gets mounted normally and mount point is browsable with both Caja and cd/ls.
    E.g.:
    #/etc/exports
    /Volumes/tank/Music/Concerts -mapall=-2:-2 -ro

  2. If a regular non-zfs drive is shared through NFS, like an APFS drive, it works as expected. Gets mounted normally and mount point is browsable with both Caja and cd/ls.
    E.g.:
    #/etc/exports
    /Volumes/VMs -mapall=-2:-2 -ro

Please note that “VMs” is a APFS formatted drive.

  1. If a regular a subdirectory on a non-zfs drive is shared through NFS. it works as expected. Gets mounted normally and mount point is browsable with both Caja and cd/ls.
    E.g.:
    #/etc/exports
    /Volumes/VMs/Linux -mapall=-2:-2 -ro

Please note that “VMs” is a APFS formatted drive and“Linux” is a regular directory.

I wrote about this in the forums and lundman advised me to open a ticket here.

I am not sure on the source of the problem and if it is related to my setup or OoX or Catalina. But I think to reproduce the problem you can create a simple Zpool and a dataset then append '/Volumes/tank/Music -mapall=-2:-2 -ro' to the /etc/exports file.

@rottegift
Copy link
Contributor

Could you update this?

If the missing files in an nfs mounted zfs datasst is still troubling you, can you please try supplying the nordirplus option to mount_nfs or mount -t nfs, or by adding nfs.client.mount.options = nordirplus to your /etc/nfs.conf ?

@aep
Copy link

aep commented Jun 20, 2023

nordirplus

i had an issue with a large amount of zfs (on linux) datasets shared over nfs4 to another linux.
A small dir was empty, but only from a single host.

This fixed it, although the manual says its for nfs3.

Edit: that did not fix it. Apparently just restarting the NFS client will fix it. And I suspect it's actually a bug there entirely unrelated to zfs. Zfs just happens to be typically used with lots of mounts.

@skorokithakis
Copy link

I have the same issue, but mount -t nfs -o nordirplus <host> <dir> doesn't work for me. The datasets still show up as empty.

@davidmarquesneves
Copy link

Almost the same here, but using ESXi NFS client:

Scenario:

NFS host:
Debian 12.2 (fully updated)
ZFS zfs-2.2.99-210_g5796e3a74 (compiled from source)
ZFS pool /dados
ZFS dataset /dados/VMsESXi
NFS nfs-kernel-server 2.6.2-4
NFS exports /dados

NFS client:
ESXi 7.0 U3 (fully updated)
NFS mount via V3 (nfs_backups = host:/dados)
Files created/copied to host at path:
/vmfs/volumes/nfs_backups/VMsESXi/*....

Result:
Files stored in a FOLDER with the same name of the dataset, not the dataset itself!
This files became visible when the dataset "dados/VMsESXi" is destroyed!

@aep
Copy link

aep commented Nov 30, 2023

Btw in the meantime we switched to ganesha which doesn't have that issue. I'm reasonably sure it's unrelated to zfs, which just happens to trigger a corner case in knfsd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants