Bug 221234 - ZFS diff does not properly display files that have been moved to a new directory.
Summary: ZFS diff does not properly display files that have been moved to a new direct...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Alan Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-04 22:54 UTC by Alan Somers
Modified: 2018-02-09 15:55 UTC (History)
0 users

See Also:
asomers: mfc-stable11+
asomers: mfc-stable10+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2017-08-04 22:54:10 UTC
The "zfs diff" command does not properly display a file that has moved to a new directory.  Instead, it shows a moved file as a modified file.

Steps to reproduce:

# zpool create tank da0
# touch /tank/foo
# mkdir /tank/bar
# zfs snapshot tank@1
# mv /tank/foo /tank/bar/
# zfs snapshot tank@2
# zfs diff tank@1 tank@2
M       /tank/
M       /tank/foo
M       /tank/bar

OpenZFS has already fixed this issue in git revision aab04418a72c0a29040a5da7eec08efe19dbef04 back in Oct-2015.  We should import it into FreeBSD.
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-08-04 23:01:59 UTC
A commit references this bug:

Author: asomers
Date: Fri Aug  4 23:01:14 UTC 2017
New revision: 322069
URL: https://svnweb.freebsd.org/changeset/base/322069

Log:
  Add a regression test for PR 221234

  etc/mtree/BSD.tests.dist
  tests/sys/cddl/zfs/tests/cli_root/Makefile
  tests/sys/cddl/zfs/tests/cli_root/zfs_diff/...
  	Add an automated test that checks the typical output of "zfs diff".
  	The is the first and only automated test for "zfs diff".  It
  	currently fails for a file that gets moved to a new directory.

  PR:		221234
  Sponsored by:	Spectra Logic Corp

Changes:
  projects/zfsd/head/etc/mtree/BSD.tests.dist
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/Makefile
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_diff/
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_diff/Makefile
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_diff/cleanup.ksh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_diff/setup.ksh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_diff/zfs_diff.cfg
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_diff/zfs_diff_001_pos.golden
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_diff/zfs_diff_001_pos.ksh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_diff/zfs_diff_test.sh
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2017-08-07 03:22:20 UTC
Assign to committer.
Comment 3 Alan Somers freebsd_committer freebsd_triage 2017-12-01 16:39:16 UTC
Fixed by avg in svn r324346, MFCed to stable/11 in 325147 and to stable/10 in r325148.
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-02-09 15:55:15 UTC
A commit references this bug:

Author: asomers
Date: Fri Feb  9 15:54:25 UTC 2018
New revision: 329065
URL: https://svnweb.freebsd.org/changeset/base/329065

Log:
  Clear an expected failure that was fixed in r324346

  PR:		221234
  Sponsored by:	Spectra Logic Corp

Changes:
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_diff/zfs_diff_test.sh