Commit 9923ad77 authored by Yan, Zheng's avatar Yan, Zheng Committed by Greg Kroah-Hartman

rbd: Fix ceph_snap_context size calculation

(cherry picked from commit f9f9a190)

ceph_snap_context->snaps is an u64 array
Signed-off-by: default avatarZheng Yan <zheng.z.yan@intel.com>
Reviewed-by: default avatarAlex Elder <elder@inktank.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6448acf6
......@@ -497,7 +497,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
snap_count = le32_to_cpu(ondisk->snap_count);
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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment