ls NFSv4 is not perfect
Andriy Gapon
avg at FreeBSD.org
Sun Apr 1 21:06:17 UTC 2012
It seems that aclmode() function in bin/ls/print.c caches ACL support properties
of a filesystem. Unfortunately this optimization doesn't always work.
An example: a UFS directory unionfs-mounted over ZFS directory. Files that
reside in ZFS and are not shadowed by UFS do have ACL_NFS4 stuff, files in UFS
don't have it.
An example of ls -l behavior in this case:
-rw-r--r-- 1 mrtg mrtg 3881 1 Apr 06:55 corevoltages-year.png
-rw-r--r-- 1 mrtg mrtg 5605 1 Apr 06:55 userload-year.png
-rw-r--r-- 1 mrtg mrtg 2782 1 Apr 06:55 uptime-year.png
ls: /var/www/stats/mrtg/cpufreq.old: Operation not supported
-rw-r--r-- 1 mrtg mrtg 61200 1 Apr 23:00 cpufreq.old
ls: /var/www/stats/mrtg/irqrate.old: Operation not supported
-rw-r--r-- 1 mrtg mrtg 55538 1 Apr 23:00 irqrate.old
ls: /var/www/stats/mrtg/cpuload.old: Operation not supported
-rw-r--r-- 1 mrtg mrtg 58826 1 Apr 23:00 cpuload.old
ls: /var/www/stats/mrtg/cpuload2.old: Operation not supported
The older files are in ZFS, the newer are in UFS.
ktrace, just in case:
CALL __acl_get_link(0x7fffffffc180,ACL_TYPE_NFS4,0x801186000)
NAMI "/var/www/stats/mrtg/uptime.html"
RET __acl_get_link 0
CALL write(0x1,0x8010be000,0x3b)
...
CALL __acl_get_link(0x7fffffffc180,ACL_TYPE_NFS4,0x801186000)
NAMI "/var/www/stats/mrtg/xxx"
RET __acl_get_link -1 errno 45 Operation not supported
Not sure what's the best approach here.
Maybe just silence this particular error code?
P.S. I know, an untypical case :-)
--
Andriy Gapon
More information about the freebsd-fs
mailing list