From: Christoph Hellwig <hch@infradead.org>
To: Josef Bacik <josef@redhat.com>
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
david@fromorbit.com
Subject: Re: [PATCH] xfs: don't take the i_mutex in ->fsync()
Date: Tue, 19 Jul 2011 10:41:48 -0400 [thread overview]
Message-ID: <20110719144148.GA3941@infradead.org> (raw)
In-Reply-To: <1311079293-3271-1-git-send-email-josef@redhat.com>
On Tue, Jul 19, 2011 at 08:41:33AM -0400, Josef Bacik wrote:
> In pushing down the i_mutex into the ->fsync() handlers I introduced a deadlock
> since xfs will call xfs_file_fsync in the O_SYNC case while still holding the
> i_mutex case. In talking with Dave he said that xfs doesn't really need to hold
> the i_mutex in xfs_file_sync() so just drop the taking of i_mutex and we should
> be good to go. Thanks,
We need some serialized around the xfs_ioend_wait call to prvent new
ioends coming in from starving our wait, be that i_mutex or the iolock.
The right fix for you patch for now is fixing xfs_file_aio_write to
call xfs_file_fsync correctly, that is removing the
filemap_write_and_wait_range call, and instead moving the fsync call
into the section where we have dropped the iolock and i_mutex.
Dave and I can then later look into dropping i_mutex in fsync and
replacing it with the iolock and/or finding a way to reduce the number
of lock roundtrips in the O_SYNC path.
prev parent reply other threads:[~2011-07-19 14:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-19 12:41 [PATCH] xfs: don't take the i_mutex in ->fsync() Josef Bacik
2011-07-19 14:41 ` Christoph Hellwig [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=20110719144148.GA3941@infradead.org \
--to=hch@infradead.org \
--cc=david@fromorbit.com \
--cc=josef@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).