[PATCH] splice: fix bugs with stealing regular pipe pages
- Check that page has suitable count for stealing in the regular pipes. - pipe_to_file() assumes that the page is locked on succesful steal, so do that in the pipe steal hook - Missing unlock_page() in add_to_page_cache() failure. Signed-off-by: Jens Axboe <axboe@suse.de>
This commit is contained in:
@@ -599,8 +599,10 @@ static int pipe_to_file(struct pipe_inode_info *info, struct pipe_buffer *buf,
|
||||
goto find_page;
|
||||
|
||||
page = buf->page;
|
||||
if (add_to_page_cache(page, mapping, index, gfp_mask))
|
||||
if (add_to_page_cache(page, mapping, index, gfp_mask)) {
|
||||
unlock_page(page);
|
||||
goto find_page;
|
||||
}
|
||||
|
||||
if (!(buf->flags & PIPE_BUF_FLAG_LRU))
|
||||
lru_cache_add(page);
|
||||
|
Reference in New Issue
Block a user