]> git.baikalelectronics.ru Git - kernel.git/commit
splice: fix leak of pages on short splice to pipe
authorJens Axboe <jens.axboe@oracle.com>
Fri, 15 Jun 2007 11:14:22 +0000 (13:14 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 15 Jun 2007 11:14:22 +0000 (13:14 +0200)
commit790f01791b98dacdd73ae8ce09cebac9b9287966
treed96e6dd310eb42e5f6c00dcc4ad8a22f6e0a92cd
parent67f23973faa8d6384141224815d50f143cb50f1f
splice: fix leak of pages on short splice to pipe

If the destination pipe is full and we already transferred
data, we break out instead of waiting for more pipe room.
The exit logic looks at spd->nr_pages to see if we moved
everything inside the spd container, but we decrement that
variable in the loop to decide when spd has emptied.

Instead we want to compare to the original page count in
the spd, so cache that in a local variable.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/splice.c