From af5f0078fd621688ccf1e0eb9b52b452f9fa419b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 12 Nov 2021 11:50:41 +0100 Subject: [PATCH] hardlink: add verbose messages when skip file Signed-off-by: Karel Zak --- misc-utils/hardlink.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/misc-utils/hardlink.c b/misc-utils/hardlink.c index b1ba70c680..7c11f644a5 100644 --- a/misc-utils/hardlink.c +++ b/misc-utils/hardlink.c @@ -850,9 +850,15 @@ static void visitor(const void *nodep, const VISIT which, const int depth) assert(other != other->next); assert(other->st.st_size == master->st.st_size); + if (!other->links) + continue; + /* check file attributes, etc. */ - if (!other->links || !file_may_link_to(master, other)) + if (!file_may_link_to(master, other)) { + jlog(JLOG_VERBOSE2, + _("Skipped (attributes mismatch) %s"), other->links->path); continue; + } /* initialize content comparison */ if (!ul_fileeq_data_associated(&master->data)) @@ -868,8 +874,11 @@ static void visitor(const void *nodep, const VISIT which, const int depth) stats.comparisons++; - if (!eq) + if (!eq) { + jlog(JLOG_VERBOSE2, + _("Skipped (content mismatch) %s"), other->links->path); continue; + } /* link files */ if (!file_link(master, other) && errno == EMLINK) { -- 2.47.3