]> granicus.if.org Git - zfs/commitdiff
Fix gcc self-comparison warning
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 30 Jul 2016 00:10:11 +0000 (17:10 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 2 Aug 2016 20:14:18 +0000 (13:14 -0700)
As of gcc 6.1.1 20160621 (Red Hat 6.1.1-3) a self-comparison is
detected by gcc in metaslab_alloc().  Resolve the warning by passing
a physical size of 0 to BP_SET_BIRTH() as it done by other callers.

  module/zfs/metaslab.c: In function â€˜metaslab_alloc’:
  module/zfs/metaslab.c:2575:184: error: self-comparison always evaluates
      to true [-Werror=tautological-compare]

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gvozden Neskovic <neskovic@gmail.com>
Issue #4907

module/zfs/metaslab.c

index c2c1d2dfc385d0488a4997b93c6e8826cd7cf4ce..a4cf39a3f4016747a3f92daab4be8fc3a2a4ad73 100644 (file)
@@ -2572,7 +2572,7 @@ metaslab_alloc(spa_t *spa, metaslab_class_t *mc, uint64_t psize, blkptr_t *bp,
 
        spa_config_exit(spa, SCL_ALLOC, FTAG);
 
-       BP_SET_BIRTH(bp, txg, txg);
+       BP_SET_BIRTH(bp, txg, 0);
 
        return (0);
 }