]> git.proxmox.com Git - mirror_zfs.git/commit
dbuf_sync_leaf: check DB_READ in state assertions
authorRob Norris <rob.norris@klarasystems.com>
Mon, 24 Jul 2023 08:02:21 +0000 (18:02 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 24 Jul 2023 23:36:17 +0000 (16:36 -0700)
commitf6facd242937e52ab1ad5a7fd3b6bbbb6ce08050
treea87a7dc9c830c181301ed7c2501e1f3bc922ccbb
parentd4edecd1a29f9162811dacf1500e2f3daf74a010
dbuf_sync_leaf: check DB_READ in state assertions

Block cloning introduced a new state transition from DB_NOFILL to
DB_READ. This occurs when a block is cloned and then read on the
current txg.

In this case, the clone will move the dbuf to DB_NOFILL, and then the
read will be issued for the overidden block pointer. If that read is
still outstanding when it comes time to write, the dbuf will be in
DB_READ, which is not handled by the checks in dbuf_sync_leaf, thus
tripping the assertions.

This updates those checks to allow DB_READ as a valid state iff the
dirty record is for a BRT write and there is a override block pointer.
This is a safe situation because the block already exists, so there's
nothing that could change from underneath the read.

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