Try to balance the dirty pages for every written pages instead of once per system call, mirroring the regular write path. Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- fs/ocfs2/file.c | 2 -- fs/splice.c | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 6fff128..a77ef6e 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -2494,8 +2494,6 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe, ret = err; else *ppos += ret; - - balance_dirty_pages_ratelimited(mapping); } return ret; diff --git a/fs/splice.c b/fs/splice.c index 46a08f7..fcb459d 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -759,6 +759,10 @@ int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf, } ret = pagecache_write_end(file, mapping, sd->pos, this_len, this_len, page, fsdata); + if (ret) + goto out; + + balance_dirty_pages_ratelimited(mapping); out: return ret; } @@ -1034,7 +1038,6 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, ret = err; else *ppos += ret; - balance_dirty_pages_ratelimited(mapping); } return ret; -- 1.7.10.4 _______________________________________________ xfs mailing list xfs@xxxxxxxxxxx http://oss.sgi.com/mailman/listinfo/xfs