From: Sage Weil Date: Tue, 21 Aug 2012 19:11:51 +0000 (-0700) Subject: ceph: avoid divide by zero in __validate_layout() X-Git-Tag: v3.6-rc3~5^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45f2e081f573526977abfa781a12728f83e9641f;p=pandora-kernel.git ceph: avoid divide by zero in __validate_layout() If "l->stripe_unit" is zero the the mod on the next line will cause a divide by zero bug. This comes from the copy_from_user() in ceph_ioctl_set_layout_policy(). Passing 0 is valid, though (it means "do not change") so avoid the % check in that case. Reported-by: Dan Carpenter Signed-off-by: Sage Weil Reviewed-by: Alex Elder --- Reading git-diff-tree failed