HomeFreeBSD

Fix corrupted l2_asize in arcstats

Description

Fix corrupted l2_asize in arcstats

Commit e0b0ca9 accidentally corrupted the l2_asize displayed in
arcstats. This was caused by changing the l2arc_buf_hdr.b_asize
member from an int to uint32_t type. There are places in the
code where this field is cast to a uint64_t resulting in the
b_hits member being treated as part of b_asize.

To resolve the issue the type has been changed to a uint64_t,
and the b_hits member is placed after the enum to prevent the
size of the structure from increasing.

This is a good example of exactly why it's a bad idea to use
ambiguous types (int) in these structures.

Signed-off-by: DHE <git@dehacked.net>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1990

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Feb 1 2014, 12:35 AM
Parents
rG2e7b7657cdb9: 4188 assertion failed in dmu_tx_hold_free(): dn_datablkshift != 0
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGc5cb66addcb9: Fix corrupted l2_asize in arcstats (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Feb 5 2014, 8:24 PM