ZFS objects used to store extended attributes are not deleted when parent file/directory is deleted. Those objects still occupy disk space but are otherwise unreferenced and can't be deleted. So far I've traced it down to sys\cddl\contrib\opensolaris\uts\common\fs\zfs\zfs_dir.c:zfs_rmnode. ZTOV(zp) is NULL for extended attributes directory (object 9) so zfs_purgedir is not called and object 10 is left alone. How-To-Repeat: # zfs create -o mountpoint=/test root/test # touch /test/file1 # setextattr user test abc /test/file1 # zdb root/test Object lvl iblk dblk dsize lsize %full type 8 1 16K 512 0 512 0.00 ZFS plain file 9 1 16K 512 1K 512 100.00 ZFS directory 10 1 16K 512 512 512 100.00 ZFS plain file object 8 - the file, object 9 - extended attributes directory, object 10 - value of the 'test' extended attribute ("abc") # rm /test/file1 # zdb root/test Object lvl iblk dblk dsize lsize %full type 10 1 16K 512 512 512 100.00 ZFS plain file objects 8 and 9 are deleted, object 10 is still there (leaked).
Can not reproduce with head code. -- Andriy Gapon
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s).
On 2013-05-04 19:26, Andriy Gapon wrote: > Can not reproduce with head code. Appears to be fixed in 9.1-STABLE too. But the problem of already leaked objects remain: 1) zpool scrub will not delete leaked objects, 2) zfs send will include leaked objects. Maybe patch scrub to detect and remove leaked objects (sysctl flag disabled by default)?