From: Yan, Zheng Date: Wed, 6 Jun 2012 14:15:33 +0000 (-0500) Subject: rbd: Fix ceph_snap_context size calculation X-Git-Tag: v3.4.20~82 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9923ad77a69ab565af2746262989cc0340943668;p=karo-tx-linux.git rbd: Fix ceph_snap_context size calculation (cherry picked from commit f9f9a1904467816452fc70740165030e84c2c659) ceph_snap_context->snaps is an u64 array Signed-off-by: Zheng Yan Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index d074ed9e233c..7b331366a8a4 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -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;