提交 f9f9a190 编写于 作者: Y Yan, Zheng 提交者: Alex Elder

rbd: Fix ceph_snap_context size calculation

ceph_snap_context->snaps is an u64 array
Signed-off-by: NZheng Yan <zheng.z.yan@intel.com>
Reviewed-by: NAlex Elder <elder@inktank.com>
上级 a5988c49
......@@ -499,7 +499,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
/ sizeof (*ondisk))
return -EINVAL;
header->snapc = kmalloc(sizeof(struct ceph_snap_context) +
snap_count * sizeof (*ondisk),
snap_count * sizeof(u64),
gfp_flags);
if (!header->snapc)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册