Bug 192715

Summary: zfs diff does not report accurate file deletion differences
Product: Base System Reporter: Kyle George <kgeorge>
Component: kernAssignee: freebsd-fs (Nobody) <fs>
Status: Open ---    
Severity: Affects Some People CC: heliocentric
Priority: ---    
Version: 9.3-RELEASE   
Hardware: amd64   
OS: Any   
See Also: https://github.com/zfsonlinux/zfs/issues/2081

Description Kyle George 2014-08-16 20:55:17 UTC
'zfs diff' does not report accurate file deletion differences.  I noticed this when I created a snapshot of a dataset, removed some files, and then performed a diff.  It did not show all the files that were removed.  Here's a recipe to reproduce:

[root@atlantis ~]# zfs create tank/test
[root@atlantis ~]# cd /tank/test
[root@atlantis /tank/test]# touch a
[root@atlantis /tank/test]# zfs snapshot tank/test@1
[root@atlantis /tank/test]# zfs snapshot tank/test@2
[root@atlantis /tank/test]# rm a
[root@atlantis /tank/test]# zfs diff tank/test@1
M       /tank/test/
-       /tank/test/a
[root@atlantis /tank/test]# zfs diff tank/test@2
M       /tank/test/
[root@atlantis /tank/test]#
[root@atlantis /tank/test]# uname -a

However, I'm not sure if this is the only case that triggers this bug.

I am running 9.3-RELEASE:

[root@atlantis /tank/test]# uname -a
FreeBSD atlantis 9.3-RELEASE FreeBSD 9.3-RELEASE #0 r268512: Thu Jul 10 23:44:39 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

I'm apparently not the only one experiencing this.  A search on Illumos' bug tracker let me to this issue:

https://www.illumos.org/issues/3043

which led to this issue in zfsonlinux:

https://github.com/zfsonlinux/zfs/issues/2081.

For what it's worth, my zpool was originally created as v28 on 9.0-RELEASE and has been upgrated to v5000 with the following feature flags:

tank  feature@async_destroy          enabled                        local
tank  feature@empty_bpobj            active                         local
tank  feature@lz4_compress           enabled                        local
tank  feature@multi_vdev_crash_dump  enabled                        local
tank  feature@spacemap_histogram     active                         local
tank  feature@enabled_txg            active                         local
tank  feature@hole_birth             active                         local
tank  feature@extensible_dataset     enabled                        local
tank  feature@bookmarks              enabled                        local
tank  feature@filesystem_limits      enabled                        local