linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Jan Kara <jack@suse.cz>
Subject: [PATCH 2/4] ext4: Avoid issuing barriers on error recovery path
Date: Tue, 27 Oct 2009 13:48:47 +0100	[thread overview]
Message-ID: <1256647729-29834-3-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1256647729-29834-1-git-send-email-jack@suse.cz>

There is no reason why we should issue IO barriers when we
just hit an error in ext4_sync_file. So move out: label to
just return and introduce flush: label to those places which
really need it.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/fsync.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 2b15312..2bf9413 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -88,7 +88,7 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
 		ret = sync_mapping_buffers(inode->i_mapping);
 
 	if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
-		goto out;
+		goto flush;
 
 	/*
 	 * The VFS has written the file data.  If the inode is unaltered
@@ -103,8 +103,9 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
 		if (ret == 0)
 			ret = err;
 	}
-out:
+flush:
 	if (journal && (journal->j_flags & JBD2_BARRIER))
 		blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
+out:
 	return ret;
 }
-- 
1.6.0.2


  parent reply	other threads:[~2009-10-27 12:48 UTC|newest]

Thread overview: 22+ 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 ` Jan Kara [this message]
2009-11-16  0:47   ` [PATCH 2/4] ext4: Avoid issuing barriers on error recovery path Theodore Tso
2009-11-16  2:40     ` [PATCH] ext4: Avoid issuing unnecessary barriers Theodore Ts'o
2009-11-16 10:29       ` 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
  -- strict thread matches above, loose matches on Subject: below --
2009-10-20  7:24 [PATCH 0/4] Fix fsync bug in ext3 and ext4 Jan Kara
2009-10-20  7:24 ` [PATCH 2/4] ext4: Avoid issuing barriers on error recovery path 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=1256647729-29834-3-git-send-email-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).