Commit 22c8c65d authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block:
  [PATCH] splice: partial write fix
parents a76c0b97 d9993c37
...@@ -627,18 +627,25 @@ static int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf, ...@@ -627,18 +627,25 @@ static int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
} }
ret = mapping->a_ops->commit_write(file, page, offset, offset+this_len); ret = mapping->a_ops->commit_write(file, page, offset, offset+this_len);
if (!ret) { if (ret) {
if (ret == AOP_TRUNCATED_PAGE) {
page_cache_release(page);
goto find_page;
}
if (ret < 0)
goto out;
/* /*
* Return the number of bytes written and mark page as * Partial write has happened, so 'ret' already initialized by
* accessed, we are now done! * number of bytes written, Where is nothing we have to do here.
*/ */
} else
ret = this_len; ret = this_len;
mark_page_accessed(page); /*
balance_dirty_pages_ratelimited(mapping); * Return the number of bytes written and mark page as
} else if (ret == AOP_TRUNCATED_PAGE) { * accessed, we are now done!
page_cache_release(page); */
goto find_page; mark_page_accessed(page);
} balance_dirty_pages_ratelimited(mapping);
out: out:
page_cache_release(page); page_cache_release(page);
unlock_page(page); unlock_page(page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment