Re: [PATCH 2/3] ext4: fix ZERO_RANGE test failure in data journalling mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 17 Apr 2014, Namjae Jeon wrote:

> Date: Thu, 17 Apr 2014 07:29:18 +0900
> From: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
> To: Theodore Ts'o <tytso@xxxxxxx>
> Cc: linux-ext4 <linux-ext4@xxxxxxxxxxxxxxx>,
>     Lukáš Czerner <lczerner@xxxxxxxxxx>
> Subject: [PATCH 2/3] ext4: fix ZERO_RANGE test failure in data journalling
>     mode
> 
> From: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
> 
> xfstests generic/091 is failing when mounting ext4 with data=journal.
> I think that this regression is same problem that occurred prior to collapse
> range issue. So ZERO RANGE also need to call ext4_force_commit as
> collapse range.
> 
> Signed-off-by: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
> Signed-off-by: Ashish Sangwan <a.sangwan@xxxxxxxxxxx>
> ---
>  fs/ext4/extents.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index f386dd6..a64242f 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -4742,6 +4742,13 @@ static long ext4_zero_range(struct file *file, loff_t offset,
>  
>  	trace_ext4_zero_range(inode, offset, len, mode);
>  
> +	/* 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;
> +	}

Hi,

it makes sense. But I have a question, maybe I do not understand it
correctly but what protect us from other writes coming in after we
force the commit ?

-Lukas

> +
>  	/*
>  	 * Write out all dirty pages to avoid race conditions
>  	 * Then release them.
> 

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux