Can not read from ZFS exported over NFSv4 but write to it

Rick Macklem rmacklem at uoguelph.ca
Tue Oct 23 21:55:18 UTC 2012


Yamagi Burmeister wrote:
> Hello,
> I have 2 boxes. Both of them are running FreeBSD 9.1-RC2. On box A a
> ZFS filesystem and an UFS filesystem are exported over NFSv4. Both
> filesystems are mounted on box B. On box B the UFS filesystem is
> working as expected. But I'm only able write to the ZFS filesystem,
> when trying to read from it only a small amount of data is transmitted
> before the NFSv4 mount stalls. A subsequent "umount -f" takes several
> minutes to complete. This behavior is 100% reproduceable.
> 
> The /etc/exports on box A:
> 
> # ZFS
> /usr/home/yamagi
> # UFS
> /mnt
> V4: / -sec=sys 192.168.0.13
> 
For ZFS, all volumes down to yamagi must be exported.
You don't show what your ZFS setup is, but you either
need to export "home" and "usr" if those are ZFS volumes.
(The above /etc/exports would be ok, only if /, /usr and
/home are all UFS volumes and /usr/home/yamagi is the root
of a ZFS volume.) For UFS, non-exported volumes can be
traversed by "mount", but for ZFS that is not the case.

The only way I know of to fix this inconsistency is to
disable the traversal capability for UFS, but that would
be a POLA violation, so the inconsistency (caused by ZFS
checking exports itself instead of leaving to the VFS layer)
remains.

OR
you can specify the root of V4 in the exported volume.
For example, you could:
# ZFS
/usr/home/yamagi
V4: /usr/home/yamagi -sec=sys 192.168.0.13

And then the client mount would be:
a:/ on /mnt
since "/" would be at /usr/home/yamagi. (If you do this,
the /mnt UFS volume wouldn't be mountable via NFSv4.)

> Mounted on box B:
> 
> % mount
> a:/usr/home/yamagi on /mnt (nfs, nfsv4acls)
> 
> After the mount stalled (just try to copy some data) the kernel on box
> B
> shows:
> nfsv4 client/server protocol prob err=10020
error 10020 is NFS4ERR_NOFILEHANDLE and that is usually
because some entry in the path isn't exported.

As such, it looks like something in the path to
/usr/home/yamagi isn't exported.

rick
ps: If you still have the problem after you are convinced
    that your /etc/exports is ok, you can capture packets
    for the ZFS mount attempt and email the packet trace to
    me. I never use ZFS, so I don't see ZFS specific problems.

> newnfs server a:/usr/home/yamagi: not responding
> newnfs server a:/usr/home/yamagi: is alive again
> newnfs server a:/usr/home/yamagi: not responding
> ...
> 
> But the network connection is stable at all times. Not a single "ping"
> failes, the ssh connection between the two hosts works just fine.
> 
> The kernel on box A doesn't show anything. The nfsd processes are
> looking fine. A "procstat -kk" doesn't show anything:
> 
> 1844 100392 nfsd nfsd: master mi_switch+0x186
> sleepq_catch_signals+0x2cc sleepq_timedwait_sig+0x19 _cv_timedwait_sig
> +0x13c svc_run_internal+0x7a1 svc_run+0x8f nfsrvd_nfsd+0x1c7
> nfssvc_nfsd +0x9b sys_nfssvc+0x90 amd64_syscall+0x546 Xfast_syscall
> +0xf7
> 
> 1838 101289 nfsd - mi_switch+0x186
> sleepq_catch_signals+0x2cc sleepq_wait_sig+0x16 _cv_wait_sig+0x12e
> seltdwait+0x110 kern_select+0x6ef sys_select+0x5d amd64_syscall+0x546
> Xfast_syscall+0xf7
> 
> Any help is welcome. More information can be provided if needed.
> 
> Ciao,
> Yamagi
> 
> --
> Homepage: www.yamagi.org
> XMPP: yamagi at yamagi.org
> GnuPG/GPG: 0xEFBCCBCB


More information about the freebsd-fs mailing list