From: Eric Sandeen <sandeen@redhat.com>
To: "Theodore Ts'o" <tytso@mit.edu>,
Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: respect the nobarrier mount option in nojournal mode
Date: Tue, 7 Jun 2016 22:23:10 -0500 [thread overview]
Message-ID: <8421f4bf-a49c-572c-c8db-29709a17eee6@redhat.com> (raw)
In-Reply-To: <1465354031-15429-1-git-send-email-tytso@mit.edu>
On 6/7/16 9:47 PM, Theodore Ts'o wrote:
> Also, if we are going to issue the barrier, we should do this after we
> write out the parent directories if necessary.
>
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
> fs/ext4/fsync.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
> index 8850254..011863e 100644
> --- a/fs/ext4/fsync.c
> +++ b/fs/ext4/fsync.c
> @@ -106,9 +106,11 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
> }
>
> if (!journal) {
> - ret = generic_file_fsync(file, start, end, datasync);
> + ret = __generic_file_fsync(file, start, end, datasync);
> if (!ret && !hlist_empty(&inode->i_dentry))
> ret = ext4_sync_parent(inode);
> + if (journal->j_flags & JBD2_BARRIER)
> + goto issue_flush;
So in the "if (!journal)" case you test journal->j_flags?
Confused...
-Eric
> goto out;
> }
>
> @@ -140,6 +142,7 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
> needs_barrier = true;
> ret = jbd2_complete_transaction(journal, commit_tid);
> if (needs_barrier) {
> + issue_flush:
> err = blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
> if (!ret)
> ret = err;
>
next prev parent reply other threads:[~2016-06-08 3:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-08 2:47 [PATCH] ext4: respect the nobarrier mount option in nojournal mode Theodore Ts'o
2016-06-08 3:23 ` Eric Sandeen [this message]
2016-06-10 18:44 ` [PATCH -v2] " Theodore Ts'o
2016-06-16 18:07 ` 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=8421f4bf-a49c-572c-c8db-29709a17eee6@redhat.com \
--to=sandeen@redhat.com \
--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).