]> 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 Mar 2013 04:07:02 +0000 (15:07 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:28:22 +0000 (16:28 +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 94b9b232c49490d9de3926bb5871045b92c32a20..859cef7e8b4ac6c26af84f67094cf299f6007155 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;
 }