mirror of https://gitee.com/openkylin/linux.git
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: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
parent
792c3a9149
commit
0bc62284ee
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue