hammer2 - Fix critical bulkfree bug, refactor hammer2_io (2)
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 29 Aug 2017 22:17:49 +0000 (15:17 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 29 Aug 2017 22:17:49 +0000 (15:17 -0700)
* Correct the bzero() in the last commit.

sys/vfs/hammer2/hammer2_bulkfree.c

index 2c7aba9..489b686 100644 (file)
@@ -371,7 +371,8 @@ hammer2_bulkfree_pass(hammer2_dev_t *hmp, hammer2_chain_t *vchain,
                 * the dedup heuristic too.
                 */
                cbinfo_bmap_init(&cbinfo, size);
-               bzero(cbinfo.dedup, sizeof(*cbinfo.dedup));
+               bzero(cbinfo.dedup, sizeof(*cbinfo.dedup) *
+                                   HAMMER2_DEDUP_HEUR_SIZE);
                incr = size / HAMMER2_FREEMAP_LEVELN_PSIZE *
                       HAMMER2_FREEMAP_LEVEL1_SIZE;
                if (hmp->voldata.volu_size - cbinfo.sbase < incr)