projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
792c3a9
)
ceph: fix divide-by-zero in __validate_layout()
author
Yan, Zheng
<zyan@redhat.com>
Tue, 14 Oct 2014 07:38:01 +0000
(15:38 +0800)
committer
Sage Weil
<sage@redhat.com>
Tue, 14 Oct 2014 19:57:05 +0000
(12:57 -0700)
The 'stripe_unit' field is 64 bits, casting it to 32 bits can result zero.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
fs/ceph/ioctl.c
patch
|
blob
|
history
diff --git
a/fs/ceph/ioctl.c
b/fs/ceph/ioctl.c
index
d7dc812
..
f851d8d
100644
(file)
--- a/
fs/ceph/ioctl.c
+++ b/
fs/ceph/ioctl.c
@@
-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;