kdbus_pool_copy(): increase off_src in loop
authorDaniel Mack <zonque@gmail.com>
Sat, 22 Mar 2014 13:50:38 +0000 (14:50 +0100)
committerDaniel Mack <zonque@gmail.com>
Sat, 22 Mar 2014 13:50:38 +0000 (14:50 +0100)
off_src is used by kdbus_pool_copy_file() to determine the offset in the
source file to copy from. We need to increase it by the number of copied
bytes after each call.

This fixes pool-to-pool copies with slices larger that PAGE_SIZE.

pool.c

diff --git a/pool.c b/pool.c
index 4b2b9d7dc78f8ef06785534bc6956b788d69c671..39b209eee61ee234a7e90e60ce9708a303150d77 100644 (file)
--- a/pool.c
+++ b/pool.c
@@ -522,6 +522,7 @@ kdbus_pool_copy(struct file *f_dst, size_t off_dst,
                        break;
                }
 
+               off_src += n;
                fpos += n;
                rem -= n;
                dpos += n;