]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ocfs2: add freeze protection to ocfs2_file_splice_write()
authorJan Kara <jack@suse.cz>
Wed, 20 Feb 2013 02:13:57 +0000 (13:13 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:19 +0000 (16:52 +1100)
ocfs2_file_splice_write() was missed when adding freeze protection to all
write paths. Fix that.

Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Cc: Marco Stornelli <marco.stornelli@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/file.c

index b5fc161bce79692f3d1e4ed67c4572984e2b1f72..ddb5b03646ba15ec35c66c3b489c270290f8ac8c 100644 (file)
@@ -2469,6 +2469,9 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe,
                        out->f_path.dentry->d_name.len,
                        out->f_path.dentry->d_name.name, len);
 
+       if (!sb_start_file_write(out))
+               return -EAGAIN;
+
        if (pipe->inode)
                mutex_lock_nested(&pipe->inode->i_mutex, I_MUTEX_PARENT);
 
@@ -2507,6 +2510,7 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe,
 
                balance_dirty_pages_ratelimited(mapping);
        }
+       sb_end_write(inode->i_sb);
 
        return ret;
 }