aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs/libzfs_diff.c
diff options
context:
space:
mode:
authorJoshua M. Clulow <[email protected]>2015-11-12 03:33:52 +0100
committerBrian Behlendorf <[email protected]>2016-01-12 10:59:24 -0800
commit616a57bea8a9b419a77853a29516507c16c09d90 (patch)
treeea4dec461ee83814c987e73c1d8b36bfc97294dd /lib/libzfs/libzfs_diff.c
parent0eb21616fabc46ca39b67fb3890637484dbf55c6 (diff)
Illumos 6268 - zfs diff confused by moving a file to another directory
6268 zfs diff confused by moving a file to another directory Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Justin Gibbs <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/6268 https://github.com/illumos/illumos-gate/commit/aab0441 Ported-by: kernelOfTruth [email protected] Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'lib/libzfs/libzfs_diff.c')
-rw-r--r--lib/libzfs/libzfs_diff.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/libzfs/libzfs_diff.c b/lib/libzfs/libzfs_diff.c
index b5fa5853f..1a4529a40 100644
--- a/lib/libzfs/libzfs_diff.c
+++ b/lib/libzfs/libzfs_diff.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Joyent, Inc.
*/
/*
@@ -54,15 +55,6 @@
#define ZDIFF_REMOVED '-'
#define ZDIFF_RENAMED 'R'
-static boolean_t
-do_name_cmp(const char *fpath, const char *tpath)
-{
- char *fname, *tname;
- fname = strrchr(fpath, '/') + 1;
- tname = strrchr(tpath, '/') + 1;
- return (strcmp(fname, tname) == 0);
-}
-
typedef struct differ_info {
zfs_handle_t *zhp;
char *fromsnap;
@@ -258,7 +250,6 @@ static int
write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj)
{
struct zfs_stat fsb, tsb;
- boolean_t same_name;
mode_t fmode, tmode;
char fobjname[MAXPATHLEN], tobjname[MAXPATHLEN];
int fobjerr, tobjerr;
@@ -319,7 +310,6 @@ write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj)
if (fmode != tmode && fsb.zs_gen == tsb.zs_gen)
tsb.zs_gen++; /* Force a generational difference */
- same_name = do_name_cmp(fobjname, tobjname);
/* Simple modification or no change */
if (fsb.zs_gen == tsb.zs_gen) {
@@ -330,7 +320,7 @@ write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj)
if (change) {
print_link_change(fp, di, change,
change > 0 ? fobjname : tobjname, &tsb);
- } else if (same_name) {
+ } else if (strcmp(fobjname, tobjname) == 0) {
print_file(fp, di, ZDIFF_MODIFIED, fobjname, &tsb);
} else {
print_rename(fp, di, fobjname, tobjname, &tsb);