BRT: Check bv_mos_entries in brt_entry_lookup()
commit19a04e5ad21e1819b95c0ed748a4f128dc25508a
authorAlexander Motin <mav@FreeBSD.org>
Thu, 12 Dec 2024 18:22:41 +0000 (12 13:22 -0500)
committerGitHub <noreply@github.com>
Thu, 12 Dec 2024 18:22:41 +0000 (12 10:22 -0800)
tree4c155ff2d1a1db1957aaa92da737b5f2d5ed8d24
parente0039c70573e455f4745a83b7d5a6a5f6f2e58a8
BRT: Check bv_mos_entries in brt_entry_lookup()

When vdev first sees some block cloning, there is a window when
brt_maybe_exists() might already return true since something was
cloned, but bv_mos_entries is still 0 since BRT ZAP was not yet
created.  In such case we should not try to look into the ZAP
and dereference NULL bv_mos_entries_dnode.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16851
module/zfs/brt.c