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.

Reviewed-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Reviewed-by: Kay Pedersen <mail@mkwg.de>
Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15251

Details

Provenance
mavAuthored on Sep 9 2023, 5:22 PM
GitHub <noreply@github.com>Committed on Sep 9 2023, 5:22 PM
Parents
rG12ce45f2606c: Intel QAT 1.7 compatibility
Branches
Unknown
Tags
Unknown