diff options
author | Yan, Zheng <zyan@redhat.com> | 2014-10-14 03:38:01 -0400 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2014-10-14 15:57:05 -0400 |
commit | 0bc62284ee3f2a228c64902ed818b6ba8e04159b (patch) | |
tree | 57217cc15af14a00b0ac6adaede8fd7a819c5c0f /fs | |
parent | 792c3a914910bd34302c5345578f85cfcb5e2c01 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index d7dc812a2249..f851d8d70158 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c | |||
@@ -41,7 +41,7 @@ static long __validate_layout(struct ceph_mds_client *mdsc, | |||
41 | /* validate striping parameters */ | 41 | /* validate striping parameters */ |
42 | if ((l->object_size & ~PAGE_MASK) || | 42 | if ((l->object_size & ~PAGE_MASK) || |
43 | (l->stripe_unit & ~PAGE_MASK) || | 43 | (l->stripe_unit & ~PAGE_MASK) || |
44 | (l->stripe_unit != 0 && | 44 | ((unsigned)l->stripe_unit != 0 && |
45 | ((unsigned)l->object_size % (unsigned)l->stripe_unit))) | 45 | ((unsigned)l->object_size % (unsigned)l->stripe_unit))) |
46 | return -EINVAL; | 46 | return -EINVAL; |
47 | 47 | ||