From: Yan, Zheng Date: Wed, 6 Jun 2012 14:15:33 +0000 (-0500) Subject: rbd: Fix ceph_snap_context size calculation X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f9f9a1904467816452fc70740165030e84c2c659;p=openwrt%2Fstaging%2Fblogic.git rbd: Fix ceph_snap_context size calculation ceph_snap_context->snaps is an u64 array Signed-off-by: Zheng Yan Reviewed-by: Alex Elder --- diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 65665c9c42c6..8b9c1734d807 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -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;