[Devel] [PATCH RHEL7 COMMIT] ms/fuse: reduce allocation size for splice_write

Konstantin Khorenko khorenko at virtuozzo.com
Mon Aug 13 15:55:39 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.9.1.vz7.70.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.9.1.vz7.70.2
------>
commit 411b88775a32b4efcaa45e7970160cc093067e41
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Mon Aug 13 15:55:39 2018 +0300

    ms/fuse: reduce allocation size for splice_write
    
    The 'bufs' array contains 'pipe->buffers' elements, but the
    fuse_dev_splice_write() uses only 'pipe->nrbufs' elements.
    
    So reduce the allocation size to 'pipe->nrbufs' elements.
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
    Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
---
 fs/fuse/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index e32908a0d103..612e9701abcf 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -2065,7 +2065,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
 
 	pipe_lock(pipe);
 
-	bufs = kvmalloc(pipe->buffers * sizeof(struct pipe_buffer), GFP_KERNEL);
+	bufs = kvmalloc(pipe->nrbufs * sizeof(struct pipe_buffer), GFP_KERNEL);
 	if (!bufs) {
 		pipe_unlock(pipe);
 		return -ENOMEM;


More information about the Devel mailing list