mirror_zfs/module
Rob N e675852bc1
dbuf: separate refcount calls for dbuf and dbuf_user
In 92dc4ad83 I updated the dbuf_cache accounting to track the size of
userdata associated with dbufs. This adds the size of the dbuf+userdata
together in a single call to zfs_refcount_add_many(), but sometime
removes them in separate calls to zfs_refcount_remove_many(), if dbuf
and userdata are evicted separately.

What I didn't realise is that when refcount tracking is on,
zfs_refcount_add_many() and zfs_refcount_remove_many() are expected to
be paired, with their second & third args (count & holder) the same on
both sides. Splitting the remove part into two calls means the counts
don't match up, tripping a panic.

This commit fixes that, by always adding and removing the dbuf and
userdata counts separately.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reported-by: Mark Johnston <markj@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16191
2024-05-15 13:03:41 -07:00
..
avl Suppress Clang Static Analyzer false positive in the AVL tree code. 2023-03-08 13:51:21 -08:00
icp Fix: FreeBSD Arm64 does not build currently 2024-04-19 10:15:38 -07:00
lua LUA: Backport CVE-2020-24370's patch 2024-02-07 11:53:05 -08:00
nvpair xdr: header cleanup 2024-04-03 15:13:27 -07:00
os zdb/ztest: send dbgmsg output to stderr 2024-05-14 09:49:00 -07:00
unicode Illumos #15286: do_composition() needs sign awareness 2023-01-05 11:16:21 -08:00
zcommon Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN. 2024-05-10 08:47:21 -07:00
zfs dbuf: separate refcount calls for dbuf and dbuf_user 2024-05-15 13:03:41 -07:00
zstd Resolve WS-2021-0184 vulnerability in zstd 2023-02-02 15:12:51 -08:00
.gitignore FreeBSD: Ignore symlink to i386 includes 2022-08-02 16:34:23 -07:00
Kbuild.in ddt: lift dedup stats out to separate file 2024-02-15 11:45:05 -08:00
Makefile.bsd Makefile.bsd: sort and cleanup source file list 2024-04-03 15:49:22 -07:00
Makefile.in check-zstd-symbols: also ignore __pfx_ symbols 2023-09-18 09:08:41 -07:00