Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bc62284 authored by Yan, Zheng's avatar Yan, Zheng Committed by Sage Weil
Browse files

ceph: fix divide-by-zero in __validate_layout()



The 'stripe_unit' field is 64 bits, casting it to 32 bits can result zero.

Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
parent 792c3a91
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;