summaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-03-31 17:43:52 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-12 04:27:54 +0200
commit08397acdd0f02d566154c9ac7f625ae8e77133b3 (patch)
treecc73c51495b875921625093ea30a9bbdbe175e40 /fs/aio.c
parentlustre: kill unused members of struct vvp_thread_info (diff)
downloadlinux-08397acdd0f02d566154c9ac7f625ae8e77133b3.tar.xz
linux-08397acdd0f02d566154c9ac7f625ae8e77133b3.zip
ioctx_alloc(): remove pointless check
Way, way back kiocb used to be picked from arrays, so ioctx_alloc() checked for multiplication overflow when calculating the size of such array. By the time fs/aio.c went into the tree (in 2002) they were already allocated one-by-one by kmem_cache_alloc(), so that check had already become pointless. Let's bury it... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r--fs/aio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 3b8467aeb5ee..40fddf4217bd 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -688,8 +688,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
nr_events *= 2;
/* Prevent overflows */
- if ((nr_events > (0x10000000U / sizeof(struct io_event))) ||
- (nr_events > (0x10000000U / sizeof(struct kiocb)))) {
+ if (nr_events > (0x10000000U / sizeof(struct io_event))) {
pr_debug("ENOMEM: nr_events too high\n");
return ERR_PTR(-EINVAL);
}