linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
	viro@ZenIV.linux.org.uk
Subject: Re: [PATCH 5/5] ext4: add locking for O_APPEND writes
Date: Tue, 15 Apr 2014 15:36:41 -0400	[thread overview]
Message-ID: <20140415193641.GF4456@thunk.org> (raw)
In-Reply-To: <20140415170540.GC10144@quack.suse.cz>

On Tue, Apr 15, 2014 at 07:05:40PM +0200, Jan Kara wrote:
> On Sat 12-04-14 13:02:41, Ted Tso wrote:
> > Al Viro pointed out that we need to make sure we only allow one
> > O_APPEND write to proceed at a time so that the the s_bitmap_maxbytes
> > check can be properly checked.
>   But this introduces lock inversion between aio_mutex and i_mutex, doesn't
> it?

Doh!  Thanks for pointing that out.  Fortunately, we don't need to
care about optimizing the AIO/DIO O_APPEND write case, so probably the
best thing to do is to unconditionally take aio_mutex and call
ext4_unwritten_wait() early, before we grab i_mutex.  So in effect
we'll treat all O_APPEND writes as being unaligned in and in need of
serialization.

I'll send out a revised version for this last patch.

     	      			    	      - Ted

      reply	other threads:[~2014-04-15 19:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-12 17:02 [RFC PATCH 0/5] Clean up ext4_file_write() Theodore Ts'o
2014-04-12 17:02 ` [PATCH 1/5] ext4: inline generic_file_aio_write() into ext4_file_write() Theodore Ts'o
2014-04-15 17:06   ` Jan Kara
2014-04-12 17:02 ` [PATCH 2/5] ext4: move ext4_file_dio_write() " Theodore Ts'o
2014-04-15 17:06   ` Jan Kara
2014-04-12 17:02 ` [PATCH 3/5] ext4: drop aio_mutex after grabbing i_mutex in ext4_file_write() Theodore Ts'o
2014-04-15 17:06   ` Jan Kara
2014-04-12 17:02 ` [PATCH 4/5] ext4: factor out common code " Theodore Ts'o
2014-04-15 17:07   ` Jan Kara
2014-04-12 17:02 ` [PATCH 5/5] ext4: add locking for O_APPEND writes Theodore Ts'o
2014-04-15 17:05   ` Jan Kara
2014-04-15 19:36     ` Theodore Ts'o [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=20140415193641.GF4456@thunk.org \
    --to=tytso@mit.edu \
    --cc=jack@suse.cz \
    --cc=linux-ext4@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).