[Devel,RHEL7,COMMIT] ext4/mfsync: fix mem size to allocate in EXT4_IOC_MFSYNC

Submitted by Konstantin Khorenko on April 29, 2017, 5:23 p.m.

Details

Message ID 201704291723.v3THNsZB013171@finist_cl7.x64_64.work.ct
State New
Series "ext4/mfsync: fix mem size to allocate in EXT4_IOC_MFSYNC"
Headers show

Commit Message

Konstantin Khorenko April 29, 2017, 5:23 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.16.1.vz7.30.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.16.1.vz7.30.10
------>
commit 6739f1bc92b020c589a53904e36136f985b90723
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Sat Apr 29 21:17:05 2017 +0400

    ext4/mfsync: fix mem size to allocate in EXT4_IOC_MFSYNC
    
    A misprint in size of allocation resulted in allocation much more memory than
    required, which results in unnecessary high order pages allocation.
    
    https://jira.sw.ru/browse/PSBM-65802
    
    Reported-by: Alexey Kuznetsov <kuznet@virtuozzo.com>
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 fs/ext4/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 9232330..117d89d 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -796,7 +796,7 @@  resize_out:
 
 		usr_fd = (__u32 __user *) (arg + sizeof(__u32));
 
-		filpp = kzalloc(mfsync.size * sizeof(*filp), GFP_KERNEL);
+		filpp = kzalloc(mfsync.size * sizeof(*filpp), GFP_KERNEL);
 		if (!filpp)
 			return -ENOMEM;
 		flags = kzalloc(mfsync.size * sizeof(*flags), GFP_KERNEL);