mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Deny block cloning is dbuf size doesn't match BP size.
I don't know an easy way to shrink down dbuf size, so just deny block cloning into dbufs that don't match our BP's size. This fixes the following situation: 1. Create a small file, eg. 1kB of random bytes. Its dbuf will be 1kB. 2. Create a larger file, eg. 2kB of random bytes. Its dbuf will be 2kB. 3. Truncate the large file to 0. Its dbuf will remain 2kB. 4. Clone the small file into the large file. Small file's BP lsize is 1kB, but the large file's dbuf is 2kB. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net> Closes #14825
This commit is contained in:
committed by
Brian Behlendorf
parent
555ef90c5c
commit
bd8c6bd66f
+1
-1
@@ -1066,7 +1066,7 @@ int dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole,
|
||||
|
||||
int dmu_read_l0_bps(objset_t *os, uint64_t object, uint64_t offset,
|
||||
uint64_t length, dmu_tx_t *tx, struct blkptr *bps, size_t *nbpsp);
|
||||
void dmu_brt_clone(objset_t *os, uint64_t object, uint64_t offset,
|
||||
int dmu_brt_clone(objset_t *os, uint64_t object, uint64_t offset,
|
||||
uint64_t length, dmu_tx_t *tx, const struct blkptr *bps, size_t nbps,
|
||||
boolean_t replay);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user