diff --git a/[refs] b/[refs] index 6d796653e2b7..ec61a94e6175 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 059a8f3734a66cb2c41731083b0cbf836721485b +refs/heads/master: ad8d6f0a783ffa2ff9b0cf09910b889715772201 diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index 7c2abd4504d7..b5fb2f3e3ac6 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -52,6 +52,15 @@ static int page_cache_pipe_buf_steal(struct pipe_inode_info *info, WARN_ON(!PageLocked(page)); WARN_ON(!PageUptodate(page)); + /* + * At least for ext2 with nobh option, we need to wait on writeback + * completing on this page, since we'll remove it from the pagecache. + * Otherwise truncate wont wait on the page, allowing the disk + * blocks to be reused by someone else before we actually wrote our + * data to them. fs corruption ensues. + */ + wait_on_page_writeback(page); + if (PagePrivate(page)) try_to_release_page(page, mapping_gfp_mask(mapping));