Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbuf: separate refcount calls for dbuf and dbuf_user #16191

Merged
merged 1 commit into from
May 15, 2024

Commits on May 11, 2024

  1. dbuf: separate refcount calls for dbuf and dbuf_user

    In 92dc4ad 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>
    Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
    robn committed May 11, 2024
    Configuration menu
    Copy the full SHA
    9341a9e View commit details
    Browse the repository at this point in the history