]> granicus.if.org Git - zfs/commit
Assert that a dnode's bonuslen never exceeds its recorded size
authorSerapheim Dimitropoulos <serapheim@delphix.com>
Thu, 15 Aug 2019 14:44:57 +0000 (07:44 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 15 Aug 2019 14:44:57 +0000 (08:44 -0600)
commit0e37a0f4f3bc4feb62a966a7c0dd64544172395f
tree3a451478c51f6d9d5ca03f853a331e06c7be9a14
parente2b31b58e8777faa51561342d72a5a30127fa4b6
Assert that a dnode's bonuslen never exceeds its recorded size

This patch introduces an assertion that can catch pitfalls in
development where there is a mismatch between the size of
reads and writes between a *_phys structure and its respective
in-core structure when bonus buffers are used.

This debugging-aid should be complementary to the verification
done by ztest in ztest_verify_dnode_bt().

A side to this patch is that we now clear out any extra bytes
past a bonus buffer's new size when the buffer is shrinking.

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #8348
module/zfs/dbuf.c
module/zfs/dnode.c