]> git.proxmox.com Git - mirror_zfs.git/commit
Preserve itx alloc size for zio_data_buf_free()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 4 Dec 2017 19:44:39 +0000 (11:44 -0800)
committerGitHub <noreply@github.com>
Mon, 4 Dec 2017 19:44:39 +0000 (11:44 -0800)
commit72841b9fd957a392bb621393685b06dc042d4523
tree77e1918dc3ae43a657f5cb059e43ce29c8e25e5e
parentd4677269f286005768ae1a0fcd3389aa6015c4c7
Preserve itx alloc size for zio_data_buf_free()

Using zio_data_buf_alloc() to allocate the itx's may be unsafe
because the itx->itx_lr.lrc_reclen field is not constant from
allocation to free.  Using a different itx->itx_lr.lrc_reclen
size in zio_data_buf_free() can result in the allocation being
returned to the wrong kmem cache.

This issue can be avoided entirely by storing the allocation size
in itx->itx_size and using that for zio_data_buf_free().

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6912
include/sys/zil.h
module/zfs/zil.c