[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>

+3 -3
+3 -3
fs/splice.c
··· 237 * fill shadow[] with pages at the right locations, so we only 238 * have to fill holes 239 */ 240 - memset(shadow, 0, i * sizeof(struct page *)); 241 - for (j = 0, pidx = index; j < i; pidx++, j++) 242 - shadow[pages[j]->index - pidx] = pages[j]; 243 244 /* 245 * now fill in the holes
··· 237 * fill shadow[] with pages at the right locations, so we only 238 * have to fill holes 239 */ 240 + memset(shadow, 0, nr_pages * sizeof(struct page *)); 241 + for (j = 0; j < i; j++) 242 + shadow[pages[j]->index - index] = pages[j]; 243 244 /* 245 * now fill in the holes