linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, dchinner@redhat.com,
	Jan Kara <jack@suse.cz>, Joel Becker <jlbec@evilplan.org>,
	ocfs2-devel@oss.oracle.com
Subject: [PATCH 3/3] ocfs2: Add freeze protection to ocfs2_file_splice_write()
Date: Mon, 12 Nov 2012 12:17:52 +0100	[thread overview]
Message-ID: <1352719072-32274-3-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1352719072-32274-1-git-send-email-jack@suse.cz>

ocfs2_file_splice_write() was missed when adding freeze protection to all
write paths. Fix that.

CC: Joel Becker <jlbec@evilplan.org>
CC: ocfs2-devel@oss.oracle.com
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ocfs2/file.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 93ef34d..9907243 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2486,6 +2486,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);
 
@@ -2527,6 +2530,7 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe,
 
 		balance_dirty_pages_ratelimited_nr(mapping, nr_pages);
 	}
+	sb_end_write(inode->i_sb);
 
 	return ret;
 }
-- 
1.7.1


  parent reply	other threads:[~2012-11-12 11:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 11:17 [PATCH 1/3] fs: Return EAGAIN when O_NONBLOCK write should block on frozen fs Jan Kara
2012-11-12 11:17 ` [PATCH 2/3] fs: Fix hang with BSD accounting on frozen filesystem Jan Kara
2012-11-12 11:17 ` Jan Kara [this message]
2012-11-12 14:03 ` [PATCH 1/3] fs: Return EAGAIN when O_NONBLOCK write should block on frozen fs Jan Kara
2012-11-12 23:37 ` Dave Chinner
2012-12-05 13:36 ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2012-12-22  1:07 [PATCH 0/3 RESEND] Fix hang with BSD process accounting and fs freezing Jan Kara
2012-12-22  1:07 ` [PATCH 3/3] ocfs2: Add freeze protection to ocfs2_file_splice_write() Jan Kara
2013-02-07 14:52 [PATCH 0/3 RESEND] Fix hang of BSD accounting on frozen filesystem Jan Kara
2013-02-07 14:52 ` [PATCH 3/3] ocfs2: Add freeze protection to ocfs2_file_splice_write() Jan Kara
2013-02-07 17:33   ` Joel Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1352719072-32274-3-git-send-email-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=dchinner@redhat.com \
    --cc=jlbec@evilplan.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).