提交 b63a1d0e 编写于 作者: O Oskari Saarenmaa 提交者: Michal Privoznik

virfile: safezero: fix buffer allocation max size

My previous commit 7dc1d4ab was supposed to change safezero to allocate
1 megabyte at maximum, but had the logic reversed and will allocate 1
megabyte at minimum (and a lot more at maximum.)
Signed-off-by: NOskari Saarenmaa <os@ohmu.fi>
上级 fc9ff1f2
......@@ -1075,7 +1075,7 @@ safezero(int fd, off_t offset, off_t len)
/* Split up the write in small chunks so as not to allocate lots of RAM */
remain = len;
bytes = MAX(1024 * 1024, len);
bytes = MIN(1024 * 1024, len);
r = VIR_ALLOC_N(buf, bytes);
if (r < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册