]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] splice: fix bugs in pipe_to_file()
authorJens Axboe <axboe@suse.de>
Mon, 1 May 2006 17:50:48 +0000 (19:50 +0200)
committerJens Axboe <axboe@suse.de>
Mon, 1 May 2006 17:50:48 +0000 (19:50 +0200)
commit437e683f4e8ca79c1547f3a0ae18eb0d9120f6ce
tree79125b2f4755e98949f0d941a0092e5d3367bbff
parent6327038cb6893934f242d6eb265905044ee41e11
[PATCH] splice: fix bugs in pipe_to_file()

Found by Oleg Nesterov <oleg@tv-sign.ru>, fixed by me.

- Only allow full pages to go to the page cache.
- Check page != buf->page instead of using PIPE_BUF_FLAG_STOLEN.
- Remember to clear 'stolen' if add_to_page_cache() fails.

And as a cleanup on that:

- Make the bottom fall-through logic a little less convoluted. Also make
  the steal path hold an extra reference to the page, so we don't have
  to differentiate between stolen and non-stolen at the end.

Signed-off-by: Jens Axboe <axboe@suse.de>
fs/pipe.c
fs/splice.c
include/linux/pipe_fs_i.h