diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/splice.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/splice.c b/fs/splice.c index 7c2abd4504d7..b5fb2f3e3ac6 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -52,6 +52,15 @@ static int page_cache_pipe_buf_steal(struct pipe_inode_info *info, | |||
52 | WARN_ON(!PageLocked(page)); | 52 | WARN_ON(!PageLocked(page)); |
53 | WARN_ON(!PageUptodate(page)); | 53 | WARN_ON(!PageUptodate(page)); |
54 | 54 | ||
55 | /* | ||
56 | * At least for ext2 with nobh option, we need to wait on writeback | ||
57 | * completing on this page, since we'll remove it from the pagecache. | ||
58 | * Otherwise truncate wont wait on the page, allowing the disk | ||
59 | * blocks to be reused by someone else before we actually wrote our | ||
60 | * data to them. fs corruption ensues. | ||
61 | */ | ||
62 | wait_on_page_writeback(page); | ||
63 | |||
55 | if (PagePrivate(page)) | 64 | if (PagePrivate(page)) |
56 | try_to_release_page(page, mapping_gfp_mask(mapping)); | 65 | try_to_release_page(page, mapping_gfp_mask(mapping)); |
57 | 66 | ||