mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-12 19:20:28 +03:00
arc_hdr_authenticate: make explicit error
On compression we could be more explicit here for cases where we can not recompress the data. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Co-authored-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: George Melikov <mail@gmelikov.ru> Closes #9416
This commit is contained in:
parent
b32d48a625
commit
01852ffbf8
@ -1787,9 +1787,13 @@ arc_hdr_authenticate(arc_buf_hdr_t *hdr, spa_t *spa, uint64_t dsobj)
|
||||
!HDR_COMPRESSION_ENABLED(hdr)) {
|
||||
abd = NULL;
|
||||
csize = zio_compress_data(HDR_GET_COMPRESS(hdr),
|
||||
hdr->b_l1hdr.b_pabd, &abd, lsize, lsize, hdr->b_complevel);
|
||||
hdr->b_l1hdr.b_pabd, &abd, lsize, MIN(lsize, psize),
|
||||
hdr->b_complevel);
|
||||
if (csize >= lsize || csize > psize) {
|
||||
ret = SET_ERROR(EIO);
|
||||
return (ret);
|
||||
}
|
||||
ASSERT3P(abd, !=, NULL);
|
||||
ASSERT3U(csize, <=, psize);
|
||||
abd_zero_off(abd, csize, psize - csize);
|
||||
free_abd = B_TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user