rbd: Fix ceph_snap_context size calculation
ceph_snap_context->snaps is an u64 array Signed-off-by: Zheng Yan <zheng.z.yan@intel.com> Reviewed-by: Alex Elder <elder@inktank.com>
This commit is contained in:
parent
a5988c490e
commit
f9f9a19044
|
@ -499,7 +499,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
|
||||||
/ sizeof (*ondisk))
|
/ sizeof (*ondisk))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
header->snapc = kmalloc(sizeof(struct ceph_snap_context) +
|
header->snapc = kmalloc(sizeof(struct ceph_snap_context) +
|
||||||
snap_count * sizeof (*ondisk),
|
snap_count * sizeof(u64),
|
||||||
gfp_flags);
|
gfp_flags);
|
||||||
if (!header->snapc)
|
if (!header->snapc)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in New Issue