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>
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index d7dc812..f851d8d 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c
@@ -41,7 +41,7 @@ /* 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;