From: Chris Mason <chris.mason@oracle.com>
To: Josef Bacik <josef@redhat.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: do not do filemap_write_and_wait_range in fsync
Date: Mon, 23 Apr 2012 19:29:45 -0400 [thread overview]
Message-ID: <20120423232945.GD22794@shiny> (raw)
In-Reply-To: <1335208001-8833-1-git-send-email-josef@redhat.com>
On Mon, Apr 23, 2012 at 03:06:41PM -0400, Josef Bacik wrote:
> We already do the btrfs_wait_ordered_range which will do this for us, so
> just remove this call so we don't call it twice. Thanks,
>
> Signed-off-by: Josef Bacik <josef@redhat.com>
> ---
> fs/btrfs/file.c | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
> index f0da02b..0c8ed6a 100644
> --- a/fs/btrfs/file.c
> +++ b/fs/btrfs/file.c
> @@ -1492,14 +1492,15 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
>
> trace_btrfs_sync_file(file, datasync);
>
> - ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
> - if (ret)
> - return ret;
> mutex_lock(&inode->i_mutex);
Hmmm, I think there are some good benefits to doing the wait
outside of the mutex.
The question is, do we need to do it again after we take the mutex? I
tend to think no, if you're racing another write with the fsync, you get
what you deserve.
-chris
next prev parent reply other threads:[~2012-04-23 23:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 19:06 [PATCH] Btrfs: do not do filemap_write_and_wait_range in fsync Josef Bacik
2012-04-23 23:29 ` Chris Mason [this message]
2012-04-24 13:14 ` Josef Bacik
2012-04-24 14:16 ` Chris Mason
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=20120423232945.GD22794@shiny \
--to=chris.mason@oracle.com \
--cc=josef@redhat.com \
--cc=linux-btrfs@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).