]> granicus.if.org Git - zfs/commitdiff
Move assert in dump_dir() in zdb
authorTom Caputi <tcaputi@datto.com>
Wed, 5 Dec 2018 17:30:28 +0000 (12:30 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 5 Dec 2018 17:30:28 +0000 (09:30 -0800)
This one line patch moves an assert in the function dump_dir()
below an error check that ensures it ran correctly. This ensures
zdb dumps the error that actually caused the problem, as opposed
to one of its symptoms.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8171

cmd/zdb/zdb.c

index 52a6715577e866e8986b755efbe0ba8382f1798f..1a9303d12ceea10ab025e070fd4e8869f6a01af8 100644 (file)
@@ -2522,15 +2522,15 @@ dump_dir(objset_t *os)
        (void) printf("\tPercent empty: %10lf\n",
            (double)(max_slot_used - total_slots_used)*100 /
            (double)max_slot_used);
-
-       ASSERT3U(object_count, ==, usedobjs);
-
        (void) printf("\n");
 
        if (error != ESRCH) {
                (void) fprintf(stderr, "dmu_object_next() = %d\n", error);
                abort();
        }
+
+       ASSERT3U(object_count, ==, usedobjs);
+
        if (leaked_objects != 0) {
                (void) printf("%d potentially leaked objects detected\n",
                    leaked_objects);