kern/167266: ZFS + new NFS export (sharenfs) leads to NAMEI leak

Oliver Brandmueller ob at
Tue Apr 24 14:20:14 UTC 2012

>Number:         167266
>Category:       kern
>Synopsis:       ZFS + new NFS export (sharenfs) leads to NAMEI leak
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 24 14:20:13 UTC 2012
>Originator:     Oliver Brandmueller
>Release:        9-STABLE
FreeBSD silver 9.0-STABLE FreeBSD 9.0-STABLE #9: Sun Apr  8 13:11:22 CEST 2012     root at silver:/usr/obj/usr/src/sys/BLACK  amd64
If you NFS export a ZFS, create/remove of a file or directory lead to the leak of a NAMEI path buffer on the NFS server.

This happens with new nfs (only NFSv3 tested) only, using the old NFS server does not trigger the NAMEI path buffer leak.

An exported UFS on the same machine/environment does not trigger the behaviour.
nfs_server_flags="-u -t -n 64"

(mountd_flags not needed, if zfs_enable is set)

Assuming, you have a USB stick or similar as /dev/da0 (it will probably         
even work with an md device):                                                   
zpool create exptest /dev/da0                                                   
zfs sharenfs="-maproot=0 localhost" exptest                                     
# check with showmount -e exporting worked as expected                          
mount localhost:/exptest /mnt                                                   
cd /mnt                                                                         
vmstat -z | fgrep NAMEI                                                         
echo test > foo                                                                 
vmstat -z | fgrep NAMEI                                                         
rm foo                                                                          
vmstat -z | fgrep NAMEI                                                         

you may repeat the creation/removal of the file several time and you will notice the NAMEI count increasing by one on each delete operation, no matter if file or directory.
No fix known.
Workaround: using old NFS server.


More information about the freebsd-bugs mailing list