From 9a6fcfd47df8bbb6567afa23092fe577d3080b77 Mon Sep 17 00:00:00 2001 From: Marcel Huber Date: Wed, 11 May 2016 21:28:33 +0200 Subject: [PATCH] Fixes bug in fix_paths() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes bug introduced in commit 7d90f569a. Hinted by gcc: libzfs_import.c: In function ‘fix_paths’: libzfs_import.c:602:28: warning: self-comparison always evaluates to true [-Wtautological-compare] if (best->ne_num_labels == best->ne_num_labels && Signed-off-by: Marcel Huber Signed-off-by: Chunwei Chen Signed-off-by: Brian Behlendorf Issue #4632 --- lib/libzfs/libzfs_import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c index e40f6f6947..d0df9e3c2a 100644 --- a/lib/libzfs/libzfs_import.c +++ b/lib/libzfs/libzfs_import.c @@ -221,7 +221,7 @@ fix_paths(nvlist_t *nv, name_entry_t *names) } /* Prefer paths earlier in the search order. */ - if (best->ne_num_labels == best->ne_num_labels && + if (ne->ne_num_labels == best->ne_num_labels && ne->ne_order < best->ne_order) { best = ne; continue;