Skip to content

Commit

Permalink
ceph: fix divide-by-zero in __validate_layout()
Browse files Browse the repository at this point in the history
The 'stripe_unit' field is 64 bits, casting it to 32 bits can result zero.

Signed-off-by: Yan, Zheng <[email protected]>
ukernel authored and liewegas committed Oct 14, 2014
1 parent 792c3a9 commit 0bc6228
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ceph/ioctl.c
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ static long __validate_layout(struct ceph_mds_client *mdsc,
/* validate striping parameters */
if ((l->object_size & ~PAGE_MASK) ||
(l->stripe_unit & ~PAGE_MASK) ||
(l->stripe_unit != 0 &&
((unsigned)l->stripe_unit != 0 &&
((unsigned)l->object_size % (unsigned)l->stripe_unit)))
return -EINVAL;

0 comments on commit 0bc6228

Please sign in to comment.