commit | 45f2e081f573526977abfa781a12728f83e9641f | [log] [tgz] |
---|---|---|
author | Sage Weil <sage@inktank.com> | Tue Aug 21 12:11:51 2012 -0700 |
committer | Sage Weil <sage@inktank.com> | Tue Aug 21 15:55:28 2012 -0700 |
tree | 0335f7ad27ed8506504201a5e558126b2ede058f | |
parent | 6d4221b53707486dfad3f5bfe568d2ce7f4c9863 [diff] |
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 <dan.carpenter@oracle.com> Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com>