Project

General

Profile

Bug #6268

zfs diff confused by moving a file to another directory

Added by Joshua M. Clulow almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Category:
zfs - Zettabyte File System
Start date:
2015-09-30
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

The zfs diff command presents a description of the changes that have occurred to files within a filesystem between two snapshots. If a file is renamed, the tool is capable of reporting this, e.g.:

cd /some/zfs/dataset/subdir
mv file0 file1

Will result in a diff record like:

R        /some/zfs/dataset/subdir/file0  ->  /some/zfs/dataset/subdir/file1

Unfortunately, it seems that rename detection only uses the base filename to determine if a file has been renamed or simply modified. This leads to misreporting only the original filename, omitting the more relevant destination filename entirely. For example:

cd /some/zfs/dataset/subdir
mv file0 ../otherdir/file0

Will result in a diff entry:

M        /some/zfs/dataset/subdir/file0

But it should really emit:

R        /some/zfs/dataset/subdir/file0  ->  /some/zfs/dataset/otherdir/file0

History

#1

Updated by Electric Monk almost 4 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit aab04418a72c0a29040a5da7eec08efe19dbef04

commit  aab04418a72c0a29040a5da7eec08efe19dbef04
Author: Joshua M. Clulow <josh@sysmgr.org>
Date:   2015-10-09T19:27:38.000Z

    6268 zfs diff confused by moving a file to another directory
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Justin Gibbs <gibbs@scsiguy.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF