ZFSv28 zfs destroy -r bug.

Dillon Kass lists at loveturtle.net
Tue Mar 22 15:42:03 UTC 2011


Hello. I posted this to freebsd-fs yesterday regarding 8.2-R & ZFSv28 patches, this morning I confirmed the same behavior on HEAD so I figured I'd also post it here (and there's higher volume :-)

I also tested this on Solaris 11 express to make sure it's specific to FreeBSD and not some kind of "feature" in newer ZFS versions..

It used to be the case that if you zfs destroy -r pool at snapshot as long as any child dataset had @snapshot the command would destroy it. In other words, pool at snapshot didn't need to exist as long as pool/dataset1 at snapshot existed. 

Here's how it should work (Solaris 11)

turtle at solaris11vm:~# zfs list -t all -r rpool1/test
NAME                         USED  AVAIL  REFER  MOUNTPOINT
rpool1/test                  127K  6.34G    34K  /rpool1/test
rpool1/test/test2             31K  6.34G    31K  /rpool1/test/test2
rpool1/test/test2 at testsnap      0      -    31K  -
rpool1/test/test3             31K  6.34G    31K  /rpool1/test/test3
rpool1/test/test3 at testsnap      0      -    31K  -
rpool1/test/test4             31K  6.34G    31K  /rpool1/test/test4
rpool1/test/test4 at testsnap      0      -    31K  -

turtle at solaris11vm:~# zfs destroy -r rpool1 at testsnap

turtle at solaris11vm:~# zfs list -t all -r rpool1/test
NAME                USED  AVAIL  REFER  MOUNTPOINT
rpool1/test         127K  6.34G    34K  /rpool1/test
rpool1/test/test2    31K  6.34G    31K  /rpool1/test/test2
rpool1/test/test3    31K  6.34G    31K  /rpool1/test/test3
rpool1/test/test4    31K  6.34G    31K  /rpool1/test/test4
turtle at solaris11vm:~# 

All snapshots named @testsnap are deleted even though rpool1 at testsnap doesn't exist. This is normal behavior.

Here's FreeBSD-CURRENT with v28

fbsd9vm# zfs list -t all -r
NAME                     USED  AVAIL  REFER  MOUNTPOINT
testpool                 475K  19.6G    21K  /testpool
testpool/test             22K  19.6G    22K  /testpool/test
testpool/test at testsnap      0      -    22K  -

fbsd9vm# zfs destroy -r testpool at testsnap
cannot destroy 'testpool at testsnap': dataset does not exist
no snapshots destroyed

fbsd9vm# zfs list -t all -r
NAME                     USED  AVAIL  REFER  MOUNTPOINT
testpool                 475K  19.6G    21K  /testpool
testpool/test             22K  19.6G    22K  /testpool/test
testpool/test at testsnap      0      -    22K  -

fbsd9vm# uname -a
FreeBSD fbsd9vm 9.0-CURRENT FreeBSD 9.0-CURRENT #2 r208649M: Mon Mar 21 22:28:02 EDT 2011     root@:/usr/obj/usr/src/sys/GENERIC  amd64

I noticed this because zfSnap is unable to destroy old snapshots (except for ones that are done to the entire pool where pool at snapshot exists)

Cheers,
Dillon


More information about the freebsd-current mailing list