From: Surbhi Palande <Surbhi.Palande@canonical.com>
To: linux-ext4@vger.kernel.org
Cc: Stephen Tweedie <sct@redhat.com>,
Andreas Dilger <adilger@sun.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext3: call blkdev_issue_flush on fsync
Date: Fri, 26 Mar 2010 21:55:20 +0200 [thread overview]
Message-ID: <1269633320.30275.25.camel@subu> (raw)
In-Reply-To: <1269622243-26689-1-git-send-email-surbhi.palande@canonical.com>
Please ignore this patch! Sorry for this!
Warm Regards,
Surbhi.
On Fri, 2010-03-26 at 18:50 +0200, Surbhi Palande wrote:
> To ensure that bits are truly on-disk after an fsync,
> we should call blkdev_issue_flush if barriers are supported.
>
> This code is seen in ext4 through commits
> d755fb384250d6bd7fd18a0930e71965acc8e72e and
> 5f3481e9a80c240f169b36ea886e2325b9aeb745.
>
> Signed-off-by: Surbhi Palande <surbhi.palande@canonical.com>
> ---
> fs/ext3/fsync.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c
> index d336341..2184a40 100644
> --- a/fs/ext3/fsync.c
> +++ b/fs/ext3/fsync.c
> @@ -29,6 +29,7 @@
> #include <linux/jbd.h>
> #include <linux/ext3_fs.h>
> #include <linux/ext3_jbd.h>
> +#include <linux/blkdev.h>
>
> /*
> * akpm: A new design for ext3_sync_file().
> @@ -46,6 +47,7 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
> {
> struct inode *inode = dentry->d_inode;
> int ret = 0;
> + journal_t *journal = EXT3_SB(inode->i_sb)->s_journal;
>
> J_ASSERT(ext3_journal_current_handle() == NULL);
>
> @@ -87,5 +89,7 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
> ret = sync_inode(inode, &wbc);
> }
> out:
> + if (journal && (journal->j_flags & JFS_BARRIER))
> + blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
> return ret;
> }
prev parent reply other threads:[~2010-03-26 19:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-26 16:50 [PATCH] ext3: call blkdev_issue_flush on fsync Surbhi Palande
2010-03-26 19:24 ` Andreas Dilger
2010-03-26 19:37 ` Eric Sandeen
2010-03-26 19:55 ` Surbhi Palande [this message]
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=1269633320.30275.25.camel@subu \
--to=surbhi.palande@canonical.com \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sct@redhat.com \
/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).