From efe7978d89f84f08afd9a3bf84a293773b66632d Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 29 Jul 2016 17:10:11 -0700 Subject: [PATCH] Fix gcc self-comparison warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Gvozden Neskovic Issue #4907 --- module/zfs/metaslab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c index c2c1d2dfc..a4cf39a3f 100644 --- a/module/zfs/metaslab.c +++ b/module/zfs/metaslab.c @@ -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); }