From aefd5a20842bde9daf8fc996751fa37ff497933d Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Thu, 10 Oct 2013 21:17:03 -0400 Subject: [PATCH] LU-4088 obdecho: Copy entire lsm, not just pointer size From linux-kernel upstream: Author: Thomas Meyer Date: Thu Sep 19 23:45:46 2013 +0200 staging: lustre: Cocci spatch "noderef" sizeof when applied to a pointer typed expression gives the size of the pointer. Found by coccinelle spatch "misc/noderef.cocci" Signed-off-by: Thomas Meyer Change-Id: If5ce3597abe1d2a806c94e34a1b7dc4c27f19e02 Reviewed-on: http://review.whamcloud.com/7922 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- lustre/obdecho/echo_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index a4bef14..0b22468 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -1424,7 +1424,7 @@ echo_copyout_lsm (struct lov_stripe_md *lsm, void *_ulsm, int ulsm_nob) if (nob > ulsm_nob) return (-EINVAL); - if (copy_to_user (ulsm, lsm, sizeof(ulsm))) + if (copy_to_user (ulsm, lsm, sizeof(*ulsm))) return (-EFAULT); for (i = 0; i < lsm->lsm_stripe_count; i++) { -- 1.8.3.1