]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ocfs2: add freeze protection to ocfs2_file_splice_write()
authorJan Kara <jack@suse.cz>
Sun, 10 Mar 2013 10:54:40 +0000 (21:54 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 12 Mar 2013 03:56:27 +0000 (14:56 +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;
 }