mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
[PATCH] splice: fix shadow[] filling logic
Clear the entire range, and don't increment pidx or we keep filling the same position again and again. Thanks to KAMEZAWA Hiroyuki. Signed-off-by: Jens Axboe <axboe@suse.de>
This commit is contained in:
parent
b043b673dc
commit
53cd9ae886
@ -237,9 +237,9 @@ static int __generic_file_splice_read(struct file *in, struct inode *pipe,
|
|||||||
* fill shadow[] with pages at the right locations, so we only
|
* fill shadow[] with pages at the right locations, so we only
|
||||||
* have to fill holes
|
* have to fill holes
|
||||||
*/
|
*/
|
||||||
memset(shadow, 0, i * sizeof(struct page *));
|
memset(shadow, 0, nr_pages * sizeof(struct page *));
|
||||||
for (j = 0, pidx = index; j < i; pidx++, j++)
|
for (j = 0; j < i; j++)
|
||||||
shadow[pages[j]->index - pidx] = pages[j];
|
shadow[pages[j]->index - index] = pages[j];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* now fill in the holes
|
* now fill in the holes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user