[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200414013008.GA90651@mit.edu>
Date: Mon, 13 Apr 2020 21:30:08 -0400
From: "Theodore Y. Ts'o" <tytso@....edu>
To: Jan Kara <jack@...e.cz>
Cc: linux-ext4@...r.kernel.org, Dmitry Monakhov <dmonakhov@...nvz.org>,
stable@...r.kernel.org
Subject: Re: [PATCH] ext4: Do not zeroout extents beyond i_disksize
On Tue, Mar 31, 2020 at 12:50:16PM +0200, Jan Kara wrote:
> We do not want to create initialized extents beyond end of file because
> for e2fsck it is impossible to distinguish them from a case of corrupted
> file size / extent tree and so it complains like:
>
> Inode 12, i_size is 147456, should be 163840. Fix? no
>
> Code in ext4_ext_convert_to_initialized() and
> ext4_split_convert_extents() try to make sure it does not create
> initialized extents beyond inode size however they check against
> inode->i_size which is wrong. They should instead check against
> EXT4_I(inode)->i_disksize which is the current inode size on disk.
> That's what e2fsck is going to see in case of crash before all dirty
> data is written. This bug manifests as generic/456 test failure (with
> recent enough fstests where fsx got fixed to properly pass
> FALLOC_KEEP_SIZE_FL flags to the kernel) when run with dioread_lock
> mount option.
>
> CC: stable@...r.kernel.org
> Fixes: 21ca087a3891 ("ext4: Do not zero out uninitialized extents beyond i_size")
> Signed-off-by: Jan Kara <jack@...e.cz>
Applied, thanks.
- Ted
Powered by blists - more mailing lists