Project

General

Profile

Actions

Bug #15877

open

zfs: Wait for txg sync if the last DRR_FREEOBJECTS might result in a hole

Added by Gordon Ross 24 days ago. Updated 15 days ago.

Status:
Pending RTI
Priority:
High
Assignee:
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
racktop:BSR-13722

Description

We ran into this: https://github.com/openzfs/zfs/pull/14358 (fix is the commit shown there).

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.

Testing done: With this patch, the system have not had panic for weeks.

Actions #1

Updated by Gordon Ross 24 days ago

  • Category set to zfs - Zettabyte File System
  • Assignee set to Toomas Soome
  • Priority changed from Normal to High
Actions #2

Updated by Electric Monk 24 days ago

  • Gerrit CR set to 3027
Actions #3

Updated by Toomas Soome 15 days ago

  • Subject changed from Race condition causes verify panic in range_tree_remove_impl to zfs: Wait for txg sync if the last DRR_FREEOBJECTS might result in a hole

Changed subject to match OpenZFS commit.

Actions #4

Updated by Toomas Soome 15 days ago

  • Status changed from New to Pending RTI
Actions #5

Updated by Toomas Soome 15 days ago

  • Description updated (diff)
  • % Done changed from 0 to 90
Actions

Also available in: Atom PDF