linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>, Jan Kara <jack@suse.cz>
Subject: [PATCH] ext4: Avoid issuing unnecessary barriers
Date: Sun, 15 Nov 2009 21:40:42 -0500	[thread overview]
Message-ID: <1258339242-2028-1-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <20091116004757.GN4323@mit.edu>

We don't to issue an I/O barrier on an error or if we force commit
because we are doing data journaling.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>
---
This patch should be equivalent to Jan's "ext4: Avoid issuing barriers
on error recovery path", but it removes more lines than it adds.  :-)

 fs/ext4/fsync.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 2b15312..a3c2507 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -60,7 +60,7 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
 
 	ret = flush_aio_dio_completed_IO(inode);
 	if (ret < 0)
-		goto out;
+		return ret;
 	/*
 	 * data=writeback:
 	 *  The caller's filemap_fdatawrite()/wait will sync the data.
@@ -79,10 +79,8 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
 	 *  (they were dirtied by commit).  But that's OK - the blocks are
 	 *  safe in-journal, which is all fsync() needs to ensure.
 	 */
-	if (ext4_should_journal_data(inode)) {
-		ret = ext4_force_commit(inode->i_sb);
-		goto out;
-	}
+	if (ext4_should_journal_data(inode))
+		return ext4_force_commit(inode->i_sb);
 
 	if (!journal)
 		ret = sync_mapping_buffers(inode->i_mapping);
-- 
1.6.5.216.g5288a.dirty


  reply	other threads:[~2009-11-16  2:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-27 12:48 [PATCH 0/4] Fix fsync on ext3 and ext4 (v2) Jan Kara
2009-10-27 12:48 ` [PATCH 1/4] ext3: Wait for proper transaction commit on fsync Jan Kara
2009-10-27 12:48 ` [PATCH 2/4] ext4: Avoid issuing barriers on error recovery path Jan Kara
2009-11-16  0:47   ` Theodore Tso
2009-11-16  2:40     ` Theodore Ts'o [this message]
2009-11-16 10:29       ` [PATCH] ext4: Avoid issuing unnecessary barriers Jan Kara
2009-10-27 12:48 ` [PATCH 3/4] ext4: Fix error handling ext4_ind_get_blocks Jan Kara
2009-11-16  2:57   ` Theodore Tso
2009-10-27 12:48 ` [PATCH 4/4] ext4: Wait for proper transaction commit on fsync Jan Kara
2009-11-04 14:57   ` Andi Kleen
2009-11-04 15:53     ` Jan Kara
2009-11-16  0:46   ` Theodore Tso
2009-11-16 10:43     ` Jan Kara
2009-12-09  3:51       ` tytso
2009-12-09  4:54         ` tytso
2009-12-09 11:29           ` Jan Kara
2009-12-09 14:32             ` tytso
2009-12-09 11:30         ` Jan Kara
2009-11-05 13:02 ` [PATCH 0/4] Fix fsync on ext3 and ext4 (v2) Jan Kara
2009-11-05 16:35   ` Aneesh Kumar K.V
2009-11-11 14:17     ` Jan Kara

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=1258339242-2028-1-git-send-email-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    /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).