From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org,
Dmitry Monakhov <dmonakhov@openvz.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] ext4: Do not zeroout extents beyond i_disksize
Date: Mon, 13 Apr 2020 21:30:08 -0400 [thread overview]
Message-ID: <20200414013008.GA90651@mit.edu> (raw)
In-Reply-To: <20200331105016.8674-1-jack@suse.cz>
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@vger.kernel.org
> Fixes: 21ca087a3891 ("ext4: Do not zero out uninitialized extents beyond i_size")
> Signed-off-by: Jan Kara <jack@suse.cz>
Applied, thanks.
- Ted
prev parent reply other threads:[~2020-04-14 1:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-31 10:50 [PATCH] ext4: Do not zeroout extents beyond i_disksize Jan Kara
2020-03-31 13:34 ` Lukas Czerner
2020-04-10 15:12 ` Jan Kara
2020-04-14 1:30 ` Theodore Y. 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=20200414013008.GA90651@mit.edu \
--to=tytso@mit.edu \
--cc=dmonakhov@openvz.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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).