]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
For db_marker inherit the db pointer for AVL comparision.
authorChunwei Chen <tuxoko@gmail.com>
Mon, 11 Dec 2023 22:42:06 +0000 (14:42 -0800)
committerGitHub <noreply@github.com>
Mon, 11 Dec 2023 22:42:06 +0000 (14:42 -0800)
commita9b937e066644c767e43aeeb46783e3139378b47
tree95cb398b65c5dde6b9ffd8e9cf7448fcacfa6585
parentb1748eaee0dd9331c3ab1c7e9d548203a4d70176
For db_marker inherit the db pointer for AVL comparision.

While evicting dbufs of a dnode, a marker node is added to the AVL.
The marker node should be inserted in AVL tree ahead of the dbuf its
trying to delete. The blkid and level is used to ensure this. However,
this could go wrong there's another dbufs with the same blkid and level
in DB_EVICTING state but not yet removed from AVL tree. dbuf_compare()
could fail to give the right location or could cause confusion and
trigger ASSERTs.

To ensure that the marker is inserted before the deleting dbuf, use
the pointer value of the original dbuf for comparision.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Sanjeev Bagewadi <sanjeev.bagewadi@nutanix.com>
Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
Closes #12482
Closes #15643
include/sys/dbuf.h
module/zfs/dnode.c
module/zfs/dnode_sync.c