summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-12-04 11:44:39 -0800
committerGitHub <[email protected]>2017-12-04 11:44:39 -0800
commit72841b9fd957a392bb621393685b06dc042d4523 (patch)
tree77e1918dc3ae43a657f5cb059e43ce29c8e25e5e /include/sys
parentd4677269f286005768ae1a0fcd3389aa6015c4c7 (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #6912
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/zil.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/zil.h b/include/sys/zil.h
index 11c7fb4a2..442fee4a1 100644
--- a/include/sys/zil.h
+++ b/include/sys/zil.h
@@ -395,6 +395,7 @@ typedef struct itx {
uint8_t itx_sync; /* synchronous transaction */
zil_callback_t itx_callback; /* Called when the itx is persistent */
void *itx_callback_data; /* User data for the callback */
+ size_t itx_size; /* allocated itx structure size */
uint64_t itx_oid; /* object id */
lr_t itx_lr; /* common part of log record */
/* followed by type-specific part of lr_xx_t and its immediate data */