mirror_zfs/tests/zfs-tests
David Hedberg 9b17d5a37d Wait for txg sync if the last DRR_FREEOBJECTS might result in a hole
If we receive a DRR_FREEOBJECTS as the first entry in an object range,
this might end up producing a hole if the freed objects were the
only existing objects in the block.

If the txg starts syncing before we've processed any following
DRR_OBJECT records, this leads to a possible race where the backing
arc_buf_t gets its psize set to 0 in the arc_write_ready() callback
while still being referenced from a dirty record in the open txg.

To prevent this, we insert a txg_wait_synced call if the first
record in the range was a DRR_FREEOBJECTS that actually
resulted in one or more freed objects.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: David Hedberg <david.hedberg@findity.com>
Sponsored by: Findity AB
Closes #11893
Closes #14358
2023-05-09 12:57:56 -07:00
..
callbacks ZTS: Add a failsafe callback to run after each test 2020-03-10 11:00:56 -07:00
cmd Fix buffered/direct/mmap I/O race 2023-04-21 13:12:35 -07:00
include Removed Python 2 and Python 3.5- support 2023-04-13 15:59:45 -07:00
tests Wait for txg sync if the last DRR_FREEOBJECTS might result in a hole 2023-05-09 12:57:56 -07:00
Makefile.am OpenZFS 7503 - zfs-test should tail ::zfs_dbgmsg on test failure 2017-04-12 13:36:48 -07:00