mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
46e678c96b
commit
0568b409c7
3 changed files with 20 additions and 23 deletions
|
@ -5,8 +5,7 @@
|
|||
|
||||
#define PIPE_BUFFERS (16)
|
||||
|
||||
#define PIPE_BUF_FLAG_STOLEN 0x01
|
||||
#define PIPE_BUF_FLAG_LRU 0x02
|
||||
#define PIPE_BUF_FLAG_LRU 0x01
|
||||
|
||||
struct pipe_buffer {
|
||||
struct page *page;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue