]> granicus.if.org Git - zfs/commitdiff
Fixes bug in fix_paths()
authorMarcel Huber <marcelhuberfoo@gmail.com>
Wed, 11 May 2016 19:28:33 +0000 (21:28 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 12 May 2016 19:36:28 +0000 (12:36 -0700)
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 <marcelhuberfoo@gmail.com>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #4632

lib/libzfs/libzfs_import.c

index 25f369db96228f4df7103052748c3d100e7a81e1..99c3d9998f2327ffd883c4300e7ad6b7896eb776 100644 (file)
@@ -599,7 +599,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;