kern/178329: [zfs] extended attributes leak

Adam Nowacki nowak at tepeserwery.pl
Sat May 4 01:00:01 UTC 2013


>Number:         178329
>Category:       kern
>Synopsis:       [zfs] extended attributes leak
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 04 01:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Adam Nowacki
>Release:        9.1-RELEASE
>Organization:
>Environment:
FreeBSD storage 9.1-RELEASE FreeBSD 9.1-RELEASE #5: Tue Apr 30 15:08:36 UTC 2013     root at storage:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
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). 
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list