zfs icon indicating copy to clipboard operation
zfs copied to clipboard

Fix ZIL clone records for legacy holes

Open amotin opened this issue 1 year ago • 0 comments

Previous code overengineered cloned range calculation by using BP_GET_LSIZE(). The problem is that legacy holes don't have the logical size, so the result will be wrong. But we also don't need to look on every block size, since they all must be identical.

How Has This Been Tested?

While debugging #16162, after some reboots I've hit panics on ZIL replay in dmu_brt_clone(), caused by too short length value, resulting in mismatch in number of blocks to clone. With this patch problem does not reproduce.

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Performance enhancement (non-breaking change which improves efficiency)
  • [ ] Code cleanup (non-breaking change which makes code smaller or more readable)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • [ ] Documentation (a change to man pages or other documentation)

Checklist:

  • [x] My code follows the OpenZFS code style requirements.
  • [ ] I have updated the documentation accordingly.
  • [ ] I have read the contributing document.
  • [ ] I have added tests to cover my changes.
  • [ ] I have run the ZFS Test Suite with this change applied.
  • [x] All commit messages are properly formatted and contain Signed-off-by.

amotin avatar May 04 '24 16:05 amotin