aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-04-30 10:36:32 -0400
committerJens Axboe <axboe@suse.de>2006-04-30 10:36:32 -0400
commit46e678c96bbd775abd05d3ddbe2fd334794f9157 (patch)
treef82b77d9f2fd5d4eb5e66bc2bb8ff5df63db3c7f /fs/splice.c
parente0a515bc6a2188f02916e976f419a8640312e32a (diff)
[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>
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/splice.c b/fs/splice.c
index a46ddd28561e..9df28d30efa0 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -599,8 +599,10 @@ static int pipe_to_file(struct pipe_inode_info *info, struct pipe_buffer *buf,
599 goto find_page; 599 goto find_page;
600 600
601 page = buf->page; 601 page = buf->page;
602 if (add_to_page_cache(page, mapping, index, gfp_mask)) 602 if (add_to_page_cache(page, mapping, index, gfp_mask)) {
603 unlock_page(page);
603 goto find_page; 604 goto find_page;
605 }
604 606
605 if (!(buf->flags & PIPE_BUF_FLAG_LRU)) 607 if (!(buf->flags & PIPE_BUF_FLAG_LRU))
606 lru_cache_add(page); 608 lru_cache_add(page);