HomeFreeBSD

Add more constraints for block cloning.

Description

Add more constraints for block cloning.

  • We cannot clone into files with smaller block size if there is

more than one block, since we can not grow the block size.

  • Block size must be power-of-2 if destination offset != 0, since

there can be no multiple blocks of non-power-of-2 size.

The first should handle the case when destination file has several
blocks but still is not bigger than one block of the source file.
The second fixes panic in dmu_buf_hold_array_by_dnode() on attempt
to concatenate files with equal but non-power-of-2 block sizes.

While there, assert that error is reported if we made no progress.

Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.

Details

Provenance
mavAuthored on Sep 8 2023, 9:25 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 10 2023, 9:02 PM
Parents
rG739db06ce7d4: Tag 2.2.0-rc4
Branches
Unknown
Tags
Unknown