]> granicus.if.org Git - zfs/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)
committerTony Hutter <hutter2@llnl.gov>
Tue, 5 Dec 2017 01:21:39 +0000 (17:21 -0800)
commit4a98780933fd0510b00a560f6e4e1e4fa79a50ac
tree9fab5c74c79b182c72d456c6a25fa54c3566eaed
parent6db8f1a0d110f158eb12f11b2decd7665cee5852
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