Project

General

Profile

Actions

Bug #12095

closed

Don't call sizeof on void

Added by Jerry Jelinek over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

This is a port from OpenZFS of commit:

511fce6b1f Don't call sizeof on void

This is generally not a very interesting fix, except for one critical change to the recent range tree memory improvements (4d7988d605 11971 Reduce loaded range tree memory usage). The following OpenZFS change from commit 511fce6b1f is important.
--- a/module/zfs/dsl_scan.c
+++ b/module/zfs/dsl_scan.c
@@ -1244,7 +1244,7 @@ dsl_scan_should_clear(dsl_scan_t *scn)
                if (queue != NULL) {
                        /* # extents in exts_by_size = # in exts_by_addr */
                        mused += zfs_btree_numnodes(&queue->q_exts_by_size) *
-                           sizeof (range_seg_t) + queue->q_sio_memused;
+                           sizeof (range_seg_gap_t) + queue->q_sio_memused;
                }
                mutex_exit(&tvd->vdev_scan_io_queue_lock);
        }

Actions #1

Updated by Jerry Jelinek over 1 year ago

To test this I did a zfs test run as validation that there are no regressions. There is no specific test for this change, but the run was normal.

Actions #2

Updated by Electric Monk over 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 028b5df8ad1713f1c0c8ba060ec660fe0a20261d

commit  028b5df8ad1713f1c0c8ba060ec660fe0a20261d
Author: Paul Dagnelie <pcd@delphix.com>
Date:   2019-12-19T20:45:25.000Z

    12095 Don't call sizeof on void
    Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Reviewed by: Matt Macy <mmacy@FreeBSD.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Reviewed by: Joice McIntosh <joicemcintosh@yahoo.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF