Skip to content

Commit 236df37

Browse files
Yan, ZhengSage Weil
authored andcommitted
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> (cherry picked from commit f9f9a19)
1 parent 5bdca4e commit 236df37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/rbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
499499
/ sizeof (*ondisk))
500500
return -EINVAL;
501501
header->snapc = kmalloc(sizeof(struct ceph_snap_context) +
502-
snap_count * sizeof (*ondisk),
502+
snap_count * sizeof(u64),
503503
gfp_flags);
504504
if (!header->snapc)
505505
return -ENOMEM;

0 commit comments

Comments
 (0)