[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1404181824060.2128@localhost.localdomain>
Date: Fri, 18 Apr 2014 18:25:49 +0200 (CEST)
From: Lukáš Czerner <lczerner@...hat.com>
To: "Theodore Ts'o" <tytso@....edu>
cc: Namjae Jeon <namjae.jeon@...sung.com>, "'Jan Kara'" <jack@...e.cz>,
"'linux-ext4'" <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 2/3] ext4: fix ZERO_RANGE test failure in data journalling
mode
On Fri, 18 Apr 2014, Theodore Ts'o wrote:
> Date: Fri, 18 Apr 2014 10:37:11 -0400
> From: Theodore Ts'o <tytso@....edu>
> To: Namjae Jeon <namjae.jeon@...sung.com>
> Cc: 'Lukáš Czerner' <lczerner@...hat.com>, 'Jan Kara' <jack@...e.cz>,
> 'linux-ext4' <linux-ext4@...r.kernel.org>
> Subject: Re: [PATCH 2/3] ext4: fix ZERO_RANGE test failure in data journalling
> mode
>
> So a couple of things. First of all, ext4_force_commit() is a very
> expensive call, so calling it twice is really not a good idea.
>
> Secondly, in the ext4_collapse_range() you are calling
> ext4_force_commit() before filemap_write_and_wait_range().
>
> /* Call ext4_force_commit to flush all data in case of data=journal. */
> if (ext4_should_journal_data(inode)) {
> ret = ext4_force_commit(inode->i_sb);
> if (ret)
> return ret;
> }
>
> /* Write out all dirty pages */
> ret = filemap_write_and_wait_range(inode->i_mapping, offset, -1);
> if (ret)
> return ret;
>
> Shouldn't we reverse these two calls?
>
> Finally, I'm wondering if we would be better off creating a new
> explicit EXT4_I(inode)->i_write_mutex which is used to block new
> writes from starting. This could also be used to subsume the
> ext4_aio_mutex.
We can maybe use something similar xfs has with their XFS_IOLOCK
-Lukas
>
> - Ted
Powered by blists - more mailing lists