dmu_buf_will_clone: only check that current txg is clean
commit0426e13271306f3c776eea0a6c938d23f3d65a75
authorRob Norris <rob.norris@klarasystems.com>
Mon, 24 Jul 2023 07:54:05 +0000 (24 17:54 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 26 Jul 2023 15:46:58 +0000 (26 08:46 -0700)
tree55a040fb2b1bd20edd686a96dd5f83b31be95b24
parent8aa4f0f0fc16bfecf47cc36fd88a7c360ffe0953
dmu_buf_will_clone: only check that current txg is clean

dbuf_undirty() will (correctly) only removed dirty records for the given
(open) txg. If there is a dirty record for an earlier closed txg that
has not been synced out yet, then db_dirty_records will still have
entries on it, tripping the assertion.

Instead, change the assertion to only consider the current txg. To some
extent this is redundant, as its really just saying "did dbuf_undirty()
work?", but it it doesn't hurt and accurately expresses our
expectations.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Kay Pedersen <mail@mkwg.de>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Original-patch-by: Kay Pedersen <mail@mkwg.de>
Sponsored-By: OpenDrives Inc.
Sponsored-By: Klara Inc.
Closes #15050
module/zfs/dbuf.c