All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Surbhi Palande <surbhi.palande@canonical.com>
Cc: linux-ext4@vger.kernel.org, Theodore Tso <tytso@mit.edu>
Subject: Re: [PATCH] ext4: Ensure writecache to disk in no journal mode
Date: Fri, 26 Mar 2010 19:37:27 +0300	[thread overview]
Message-ID: <87pr2rhwe0.fsf@openvz.org> (raw)
In-Reply-To: <1269620462-25906-1-git-send-email-surbhi.palande@canonical.com> (Surbhi Palande's message of "Fri, 26 Mar 2010 18:21:02 +0200")

Surbhi Palande <surbhi.palande@canonical.com> writes:

> Ensure that in the no journal mode the write cache is flushed to the disk by
> calling a blkdev_issue_flush() which issues a WRITE_BARRIER if necessary.
As soon as i understand, nojournal mode is assumed to be used for
fail-free block devices(raid + UPS). So we don't have to worry about
blkdev's wcache vs persistent storage correctness.
>
> Signed-off-by: Surbhi Palande <surbhi.palande@canonical.com>
> ---
>  fs/ext4/fsync.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
> index d6049e4..1d73a50 100644
> --- a/fs/ext4/fsync.c
> +++ b/fs/ext4/fsync.c
> @@ -67,8 +67,12 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
>  	if (ret < 0)
>  		return ret;
>  
> -	if (!journal)
> -		return simple_fsync(file, dentry, datasync);
> +	if (!journal) {
> +		ret = simple_fsync(file, dentry, datasync);
> +		if (test_opt(inode->i_sb, BARRIER))
> +			blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
> +		return ret;
> +	}
>  
>  	/*
>  	 * data=writeback,ordered:

  reply	other threads:[~2010-03-26 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 16:21 [PATCH] ext4: Ensure writecache to disk in no journal mode Surbhi Palande
2010-03-26 16:37 ` Dmitry Monakhov [this message]
2010-03-26 17:16   ` Ric Wheeler
2010-03-26 17:40     ` Eric Sandeen

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=87pr2rhwe0.fsf@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=surbhi.palande@canonical.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.