Commit 04124278 authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Jim Harris
Browse files

bdev: assert against bdev_io buffer overflow



Also updated docs.

Change-Id: I2e53c31b2c9c575d8adea23ed92f113e69f324ed
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/380490


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent b5c0a51e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -380,7 +380,9 @@ void spdk_bdev_poller_stop(struct spdk_bdev_poller **ppoller);
 * \param bdev_io I/O to allocate buffer for.
 * \param cb callback to be called when the buffer is allocated
 * or the bdev_io has an SGL assigned already.
 * \param len size of the buffer to allocate.
 * \param len size of the buffer to allocate. In case the bdev_io
 * doesn't have an SGL assigned this field must be no bigger than
 * \c SPDK_BDEV_LARGE_BUF_MAX_SIZE.
 */
void spdk_bdev_io_get_buf(struct spdk_bdev_io *bdev_io, spdk_bdev_io_get_buf_cb cb, uint64_t len);

+1 −0
Original line number Diff line number Diff line
@@ -282,6 +282,7 @@ spdk_bdev_io_get_buf(struct spdk_bdev_io *bdev_io, spdk_bdev_io_get_buf_cb cb, u
		return;
	}

	assert(len <= SPDK_BDEV_LARGE_BUF_MAX_SIZE);
	ch = spdk_io_channel_get_ctx(bdev_io->ch->mgmt_channel);

	bdev_io->buf_len = len;